September 2001
Intermediate to advanced
768 pages
32h 45m
English
mixed current(array array) Returns the current element in the array without moving the internal array pointer.
Returns:
Value of the current element in the array; FALSE when no more elements exist
Description:
Returns the element value currently pointed to by the internal array pointer. This can be useful with next() and prev() in order to traverse an array; however, this is dangerous. The reason is that current() returns the value of the current element; if this evaluates to FALSE, there is no way to tell whether you’ve actually hit the end of the array being traversed or the current element simply has a value of FALSE.
This function does not move the internal array pointer.
Version:
PHP 3, PHP 4
See also:
end() key() next() prev() ...
Read now
Unlock full access