English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية

PHP Basic Tutorial

PHP Advanced Tutorial

PHP & MySQL

PHP Reference Manual

PHP pos() Function Usage and Example

PHP Array Function Manual

pos() is an alias of the current() function

Syntax

pos ( $array );

Definition and Usage

The pos() function is an alias of the current() function, it only returns the value of the array element currently pointed to by the internal pointer. It does not move the pointer in any way. If the internal pointer points to the end of the element list, pos() returns FALSE.

Parameter

Serial NumberParameters and Description
1

array(Required)

It specifies an array

Return value

It returns the current element in the array.

Online example

<?php
   $input = array('foot', 'bike', 'car', 'plane');
   $mode = pos($input); 
   print "$mode <br />";
?>
Test and see‹/›

Output result:

foot

   PHP Array Function Manual