close

函數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 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.

函數virtual()
描述:
virtual()

數組函數 example

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

$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.

 

函數count()
描述:
計算一變量中元素的個數
int count (mixed var); 
Returns the number of elements in var , which is typically an array (since anything else will have one element). 
Returns 0 if the variable is not set. 
Returns 1 if the variable is not an array.

 

函數current()
描述:
傳回數組指針目前所指的元素

 

mixed current (array array); 

 

Each array variable has an internal pointer that points to one of its elements. In addition, all of the elements in the array are linked by a bidirectional linked list for traversing purposes. The internal pointer points to the first element that was inserted to the array until you run one of the functions that modify that pointer on that array.

 

The current() function simply returns the array element that's currently being pointed by the internal pointer. It does not move the pointer in any way. If the internal pointer points beyond the end of the elements list, current() returns false. 

 

函數each()
描述:
返回數組中下一對key/value的值

 

array each (array array); 

 

Returns the current key/value pair from the array array and advances the array cursor. This pair is returned in a four-element array, with the keys 0 , 1 , key , and value . Elements 0 and key each contain the key name of the array element, and 1 and value contain the data.

 

Example 1. each() examples 

 

$foo = array( "bob", "fred", "jussi", "jouni" ); $bar = each( $foo ); 
$bar now contains the following key/value pairs:

 

0 => 0 
1 => 'bob' 
key => 0 
value => 'bob'

 

$foo = array( "Robert" => "Bob", "Seppo" => "Sepi" ); $bar = each( $foo ); 

 

$bar now contains the following key/value pairs: 

 

0 => 'Robert' 
1 => 'Bob' 
key => 'Robert' 
value => 'Bob'

 

Example 2. Traversing $HTTP_POST_VARS with each()

 

echo "Values ​​submitted via POST method:<br>"; 
while ( list( $key, $val ) = each( $HTTP_POST_VARS ) ) { 
echo "$key => $val<br>"; 
}

 

函數end()
描述:
將數組中的指針移到最後一個
end (array array); 
end() advances array 's internal pointer to the last element.

 

函數key()
描述:
從一數組中取出key 
mixed key (array array); 
key() returns the index element of the current array position.

 

函數ksort()
描述:
以key來排列一數組
Example 1. ksort() example

 

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

 

This example would display: fruits[a] = orange fruits[b] = banana fruits[c] = apple fruits[d] = lemon 

 

函數list()
描述:
用類似數組的方式去指定一整串變量的值
Example 1. list() example

 

<table> <tr> <th> Employee name</th> 
<th>Salary</th> </tr> 
<?php $result = mysql($conn, "SELECT id, name, salary FROM employees"); 
while (list($id, $name, $salary) = mysql_fetch_row($result)) { 
print(" <tr>\n"."<td><a href=\"info.php3?id=$id\ ">$name</a></td>\n"."<td>$salary</td>\n"." </tr>\n"); 
} 
?> 
</table>

 

函數next()
描述:
將數組的指向指到下一組數據

 


函數pos()
描述:
傳回數組的當前的數據

 

函數prev()
描述:
傳回數組的前一條的數據

 

函數reset()
描述:
數組的指針指到第一條

 

函數rsort ()
描述:
以倒序方式排列一個數組
Example 1. rsort() example

 

$fruits = array("lemon","orange","banana","apple"); 
rsort($fruits); 
for(reset($fruits); ($key,$value) = each($fruits); ) { 
echo "fruits[$key] = ".$value."\n"; 
}

 

This example would display: fruits[0] = orange fruits[1] = lemon fruits[2] = banana fruits[3] = apple The fruits have been sorted in reverse alphabetical order.

 

函數sizeof()
描述:
取得一個數組的大小和元素的數目

 

函數sort()
描述:
排序數組
Example 1. sort() example

 

$fruits = array("lemon","orange","banana","apple"); 
sort($fruits); 
for(reset($fruits); 
$key = key($fruits); 
next($fruits) ) { 
echo "fruits[$key] = ".$fruits[$key]."\n"; 
}

 

This example would display: fruits[0] = apple fruits[1] = banana fruits[2] = lemon fruits[3] = orange The fruits have been sorted in alphabetical order.



函数uasort()
描述:
以自定义的方式排列一个数组且序列不变。

 


函数uksort()
描述:
以自定义的方式以key排列
This function will sort the keys of an array using a user-supplied comparison function. If the array you wish to sort needs to be sorted by some non-trivial criteria, you should use this function. Example 1. uksort() example

 

function mycompare($a, $b) {
if ($a == $b) return 0;
return ($a > $b) ? -1 : 1;
}
$a = array(4 => "four", 3 => "three", 20 => "twenty", 10 => "ten"); 
uksort($a, mycompare); 
while(list($key, $value) = each($a)) {
echo "$key: $value\n"; 
}

 


This example would display: 20: twenty 10: ten 4: four 3: three

 

函数usort()
描述:
以自定义的方式以value排列

 

 

 

void usort (array array, function cmp_function);

 

 

 

This function will sort an array by its values using a user-supplied comparison function. If the array you wish to sort needs to be sorted by some non-trivial criteria, you should use this function. Example 1. usort() example

 

 

 

function cmp($a,$b) {
if ($a == $b) return 0;
return ($a > $b) ? -1 : 1;
} 
$a = array(3,2,5,6,1);
usort($a, cmp); 
while(list($key,$value) = each($a)) { 
echo "$key: $value\n"; 
}

 

 

 


This example would display: 0: 6 1: 5 2: 3 3: 2 4: 1 Obviously in this trivial case the rsort() function would be more appropriate.

 

BC (Arbitrary Precision) Functions

 


 

 

函数bcadd()
描述:
Add two arbitrary precision numbers
string bcadd (string left operand, string right operand, int [ scale ]); 左面的字符加右面的字符,返回一个字符。

 


 

 

函数bccomp()
描述:
int bccomp (string left operand, string right operand, int [ scale ]); 
左面的字符和右面的字符进行比较,如果相等的话返回0,如果左面的比右面的长返回+1,右面的比左面的长返回-1

 


 

 

函数bcdiv()
描述:
Divide two arbitrary precision numbers
string bcdiv (string left operand, string right operand, int [ scale ]); 将左面的字符串以右面的字符串为标准分开

 


 

 

函数bcmod()
描述:
Get modulus of an arbitrary precision number
string bcmod (string left operand, string modulus); 
用右面的modulus操作左面的字符串

 


 

 

函数bcmul()
描述:
Multiply two arbitrary precision number
string bcmul (string left operand, string right operand, int [ scale ]); 
Multiply the left operand by the right operand and returns the result. The optional scale sets the number of digits
after the decimal place in the result.

 


 

 

函数bcpow()
描述:
Raise an arbitrary precision number to another. 
Raise x to the power y . The scale can be used to set the number of digits after the decimal place in the result.

 


 

 

函数bcscale()
描述:
Set default scale parameter for all bc math functions. 
string bcscale (int scale);
This function sets the default scale parameter for all subsequent bc math functions that do not explicitly specify a scale
parameter

 


 

 

函数bcsqrt()
描述;
string bcsqrt (string operand, int scale); 
返回字符的平方根

 


 

 

函数bcsub()
描述:
string bcsub (string left operand, string right operand, int [ scale ]); 
将右面的字符减去左面的字符

 


 

 

Calendar Functions日历功能

 


 

 

函数JDToGregorian()
描述:
string jdtogregorian (int julianday); 
将Julian日历转换成Gregorian日历

 


 

 

函数GregorianToJD() 
描述:
int gregoriantojd (int month, int day, int year);
将Gregorian日历转换成Julian日历

 


 

 

函数JDToJulian ()
描述:
string jdtojulian (int julianday); 
将Julian Calendar转换Julian Day

 


 

 

函数JulianToJD ()
描述:
int juliantojd (int month, int day, int year);

 


 

 

函数JDToJewish ()
描述:
Converts a Julian Day Count to the Jewish Calendar 
string jdtojewish (int julianday);

 


 

 

函数JewishToJD() 
描述:
Converts a date in the Jewish Calendar to Julian Day Count 
int jewishtojd (int month, int day, int year);

 


 

 

函数JDToFrench() 
描述:
Converts a Julian Day Count to the French Republican Calendar 
string jdtofrench (int month, int day, int year);

 


 

 

函数FrenchToJD() 
描述:
Converts a date from the French Republican Calendar to a Julian Day Count int frenchtojd (int month, int day, int year);

 

函数JDMonthName ()
描述:
Returns a month name 
string jdmonthname (int julianday, int mode); 
Mode Meaning 
0 Gregorian - apreviated 
1 Gregorian 
2 Julian - apreviated 
3 Julian 
4 Jewish 
5 French Republican

 

函数JDDayOfWeek ()
描述:
Returns the day of the week 
mixed jddayofweek (int julianday, int mode); 
Mode Meaning 
0 returns the day number as an int (0=sunday, 1=monday, etc) 
1 returns string containing the day of week (english-gregorian) 
2 returns a string containing the abreviated day of week (english-gregorian)

 

 

全站熱搜
創作者介紹
創作者 Robin 的頭像
Robin

夢想工程

Robin 發表在 痞客邦 留言(0) 人氣()