PHP Array pos() Function
Last Updated : 17 Mar 2025
The PHP pos( ) function is used to fetch the value of the current element in an array. The PHP pos( ) function is an alias of current( ) function. This function was introduced in PHP 4.0.
Syntax
Parameter
| Parameter | Description | Is compulsory |
|---|---|---|
| array | Specifies the array to use. | compulsory |
Returns
The pos( ) function returns the value of the current element in an array or false on empty elements.
Example 1
Output:
aajtak
Example 2
Output:
aajtak zeenews
Example 3
Output:
archery badminton badminton
Example 4
Output:
archery badminton badminton archery badminton
Next TopicPhp-array-prev-function