Easy Tutorial
❮ Func String Str Split Func Filesystem Rename ❯

PHP current() Function

Complete PHP Array Reference Manual

Example

Output the value of the current element in the array:


Definition and Usage

The current() function returns the value of the current element in an array.

Each array has an internal pointer to its "current" element, which initially points to the first element inserted into the array.

Note: This function does not move the array's internal pointer.

Related methods:


Syntax

Parameter Description
array Required. Specifies the array to use.

Technical Details

Return Value: Returns the value of the current element in the array, or FALSE if the current element is empty or has no value.
PHP Version: 4+
--- ---

More Examples

Example 1

Demonstration of all related methods:


❮ Func String Str Split Func Filesystem Rename ❯