[PHP]實用函數(shù)10
更新時間:2007年11月08日 21:58:16 作者:
//將IP點分地址的字符轉(zhuǎn)化回IP v4格式地址
int ip2long(string ip_address)
//將IP v4格式地址轉(zhuǎn)化回IP點分地址的字符串
string long2ip(int proper_address)
//取得環(huán)境變量 varname,成功則傳回變量值,失敗由傳回false
string getenv(string varname)
//用來設(shè)定系統(tǒng)環(huán)境
void putenv(string setting)
//獲得當(dāng)前PHP腳本的屬主名
string get_current_user(void)
//調(diào)用function_name指定的用戶函數(shù)
string get_cfg_var(string function_name[,mixed parrameter[,mixed...]])
//返回與 service 關(guān)聯(lián)的端口(protocol),必須是TCP或UDP
int getservbyname(string service,string protocol)
//返回與 port 關(guān)聯(lián)的服務(wù)名(protocol),必須是TCP或UDP
string getservbyport(int port,string protocol)
//取絕對值
mixed abs(mixed number)
//開平方根
float sqrt(float arg)
//自然對數(shù)e的次方值
float exp(float arg)
//返回圓周率
double pi(void)
//四舍五入
double round(double val)
//計算大于指定數(shù)的最小整數(shù)
int ceil(float number)
//計算小于指定的最大整數(shù)
int floor(float number)
//取最大值
mixed max(mixed arg1,mixed arg2...mixed argn)
//取最小值
mixed min(mixed arg1,mixed arg2...mixed argn)
//取隨機(jī)數(shù)
int rand([int min],[int max])
//數(shù)制轉(zhuǎn)換
string base_convert(string number,int frombase,int tobase)
//格式化數(shù)字字符串
string number_format(float number,int[decimals],string[decpoint],string[thounsands_sep])
int ip2long(string ip_address)
//將IP v4格式地址轉(zhuǎn)化回IP點分地址的字符串
string long2ip(int proper_address)
//取得環(huán)境變量 varname,成功則傳回變量值,失敗由傳回false
string getenv(string varname)
//用來設(shè)定系統(tǒng)環(huán)境
void putenv(string setting)
//獲得當(dāng)前PHP腳本的屬主名
string get_current_user(void)
//調(diào)用function_name指定的用戶函數(shù)
string get_cfg_var(string function_name[,mixed parrameter[,mixed...]])
//返回與 service 關(guān)聯(lián)的端口(protocol),必須是TCP或UDP
int getservbyname(string service,string protocol)
//返回與 port 關(guān)聯(lián)的服務(wù)名(protocol),必須是TCP或UDP
string getservbyport(int port,string protocol)
//取絕對值
mixed abs(mixed number)
//開平方根
float sqrt(float arg)
//自然對數(shù)e的次方值
float exp(float arg)
//返回圓周率
double pi(void)
//四舍五入
double round(double val)
//計算大于指定數(shù)的最小整數(shù)
int ceil(float number)
//計算小于指定的最大整數(shù)
int floor(float number)
//取最大值
mixed max(mixed arg1,mixed arg2...mixed argn)
//取最小值
mixed min(mixed arg1,mixed arg2...mixed argn)
//取隨機(jī)數(shù)
int rand([int min],[int max])
//數(shù)制轉(zhuǎn)換
string base_convert(string number,int frombase,int tobase)
//格式化數(shù)字字符串
string number_format(float number,int[decimals],string[decpoint],string[thounsands_sep])
相關(guān)文章
DW中鏈接mysql數(shù)據(jù)庫時,建立字符集中文出現(xiàn)亂碼的解決方法
DW中鏈接mysql數(shù)據(jù)庫時,建立字符集中文出現(xiàn)亂碼“????”2010-03-03php下刪除字符串中HTML標(biāo)簽的函數(shù)
一個可以刪除字符串中html標(biāo)記的php函數(shù)2008-08-08php使用Jpgraph繪制復(fù)雜X-Y坐標(biāo)圖的方法
這篇文章主要介紹了php使用Jpgraph繪制復(fù)雜X-Y坐標(biāo)圖的方法,通過設(shè)置圖像陰影、邊距、字體、顏色、曲線等實現(xiàn)Jpgraph繪制復(fù)雜坐標(biāo)圖的功能,非常簡單實用,需要的朋友可以參考下2015-06-06php checkdate、getdate等日期時間函數(shù)操作詳解
PHP的日期時間函數(shù)date()中介紹了PHP日期時間函數(shù)的簡單用法,這類將介紹更多的函數(shù)來豐富我們的應(yīng)用。2010-03-03php定義參數(shù)數(shù)量可變的函數(shù)用法實例
這篇文章主要介紹了php定義參數(shù)數(shù)量可變的函數(shù)用法,實例分析了func_get_args的使用技巧,具有一定參考借鑒價值,需要的朋友可以參考下2015-03-03