国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 開發 > PHP > 正文

PHP中文函數連載(一)

2024-05-04 23:05:15
字體:
來源:轉載
供稿:網友

函數abs()

描述:

mixed abs (mixed number);

returns the absolute value of number. if the argument number is float, return type is also float, otherwise it is int(返回所輸的數字的絕對值,浮點型返回浮點型,其他返回整型)

函數acos()

描述:

float acos (float arg);

returns the arc cosine of arg in radians(返回角的余弦值)
adabas d功能
函數ada_afetch()
描述:
fetch a result row into an array(返回結果到一個數組里)
函數ada_autocommit()
描述:
toggle autocommit behaviour

函數ada_close()
描述:
close a connection to an adabas d server (關掉一個數據庫的關聯)

函數ada_commit()
描述:
commit a transaction (提交一個處理)

函數ada_connect()
描述:
connect to an adabas d datasource(聯接一個數據庫)
函數ada_exec()
描述:
prepare and execute a sql statement(執行一個sql語句)
函數ada_fetchrow()
描述:
fetch a row from a result(從數據庫中取一條記錄)

函數ada_fieldname()
描述:
get the columnname(得到字段名)
函數ada_fieldnum()
描述:
get column number(得到字段的總數)

函數ada_fieldtype()
描述:
get the datatype of a field(取得字段的類型)

函數ada_freeresult()
描述:
free resources associated with a result

函數ada_numfields()
描述:
get the number of columns in a result(在結果中得到字段數目)

函數ada_numrows()
描述:
number of rows in a result(所取結果的記錄數)

函數ada_result()
描述:
get data from results(得到結果的數據)

函數ada_resultall()
描述:
print result as html table(以html的格式輸出結果)

函數ada_rollback()
描述:
rollback a transaction

函數apache_lookup_uri()
描述:
perform a partial request for the specified uri and return all info about it,this performs a partial request for a uri. it goes just far enough to obtain all the important information about the given resource and returns this information in a class. the properties of the returned class are:

status:the_request、status_line、method、content_type、handler
uri:filename、path_info、args、boundary、no_cache、no_local_copy、 allowed、send_bodyct、bytes_sent、byterange、clength、unparsed_uri mtime、request_time

函數apache_note()
描述:
get and set apache request notes,apache_note() is an apache-specific function which gets and sets values in a request's notes table. if called with one argument, it returns the current value of note note_name . if called with two arguments, it sets the value of note note_name to note_value and returns the previous value of note note_name .

函數getallheaders()
描述:
fetch all http request headers(取得所有http頭部請求)
例子:
$headers = getallheaders();
while (list($header, $value) = each($headers)) {
echo "$header: $value
/n";
}
這個例子將顯示返回所有最近的頭部請求。
注:此函數只支持apache下的php

函數virtual()
描述:
virtual()
is an apache-specific function which is equivalent to in mod_include. it performs an apache sub-request. it is useful for including cgi scripts or .shtml files, or anything else that you would parse through apache. note that for a cgi script, the script must generate valid cgi headers. at the minimum that means it must generate a content-type header.

數組函數

函數array()
描述:
建立一個數組
array array(...)傳回一數組的值,這些值可以用=>來附值。
下面說明了如何構建一個二維數組,及如何指定這個數組的key,以及在正常的數組中以跳序的方式去指定數組的值。
example 1. array()
example

$fruits = array(
"fruits" => array("a"=>"orange","b"=>"banana","c"=>"apple"),
"numbers" => array(1, 2, 3, 4, 5, 6),
"holes" => array("first", 5 => "second", "third")
);

函數array_walk()
描述:
函數的方式對每個數組的元素做處理
int array_walk (array arr, string func);
使用一個叫func的函數對arr的每個元素做處理,那些元素將當成是首傳給func的參數;如果func需要超過一個參數,則在每次array_walk()呼叫func時都產生一個警告信息,這些警告信息是可以消除的,只要把'@'符號加在array_walk()
之前即可。
注意:func會直接對arr中的元素做處理,所以任何元素的變化將直接改變其在數組中的值。
example 1. array_walk() example

$fruits = array("d"=>"lemon","a"=>"orange","b"=>"banana","c"=>"apple");
function test_alter( $item1 ) { $item1 = 'bogus'; }
function test_print( $item2 ) { echo "$item2
/n"; }
array_walk( $fruits, 'test_print' );
array_walk( $fruits, 'test_alter' );
array_walk( $fruits, 'test_print' );

函數arsort()
描述:
以倒序的方式排列一數組但其序數則不變

void arsort (array array);

this function sorts an array such that array indices maintain their correlation with the array elements they are associated with. this is used mainly when sorting associative arrays where the actual element order is significant. example 1. arsort() example

$fruits = array("d"=>"lemon","a"=>"orange","b"=>"banana","c"=>"apple");
arsort($fruits);
for(reset($fruits); $key = key($fruits); next($fruits)) {
echo "fruits[$key] = ".$fruits[$key]."/n";
}

this example would display: fruits[a] = orange fruits[d] = lemon fruits[b] = banana fruits[c] = apple the fruits have been sorted in reverse alphabetical order, and the index associated with each element has been maintained.

函數asort()
描述:
順序排列一數組且其序數不變

void asort (array array);

this function sorts an array such that array indices maintain their correlation with the array elements they are associated with. this is used mainly when sorting associative arrays where the actual element order is significant. example 1. asort() example

$fruits = array("d"=>"lemon","a"=>"orange","b"=>"banana","c"=>"apple");
asort($fruits);
for(reset($fruits); $key = key($fruits); next($fruits)) {
echo "fruits[$key] = ".$fruits[$key]."/n";
}


this example would display: fruits[c] = apple fruits[b] = banana fruits[d] = lemon fruits[a] = orange the fruits have been sorted in alphabetical order, and the index associated with each element has been maintained.

發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 普定县| 凤山县| 永清县| 周至县| 鄱阳县| 剑川县| 高青县| 保康县| 车险| 上饶市| 渭南市| 青神县| 禹州市| 隆昌县| 永康市| 吉林市| 鸡泽县| 榆社县| 黑水县| 和硕县| 杭州市| 濉溪县| 电白县| 敦煌市| 晋江市| 中江县| 阿克| 松滋市| 塘沽区| 元阳县| 伊宁县| 正安县| 南皮县| 那曲县| 大英县| 延庆县| 龙山县| 仁化县| 岑溪市| 邵武市| 紫云|