时间:2021-07-01 10:21:17 帮助过:25人阅读
函数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()
http://www.bkjia.com/PHPjc/445545.htmlwww.bkjia.comtruehttp://www.bkjia.com/PHPjc/445545.htmlTechArticle函数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(返回所输的数...