Easy Tutorial
❮ Filter Sanitize Encoded Func String Addcslashes ❯

PHP pos() Function

Complete PHP Array Reference Manual

Example

Outputs the value of the current element in an array:


Definition and Usage

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

This function is an alias of the current() function.

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:


❮ Filter Sanitize Encoded Func String Addcslashes ❯