PHP Array pos() Function

What is pos() Function?

Explanation

The "pos()" function is the alias of current() function.

Syntax:


pos(array)

In the above syntax "array" is the array from which the current element is to be displayed.

Example :


<?php
$b=array("Grapes","Apple","Cherry");
echo pos($b);
?>
Result :

Grapes

In the above example from the array "$b", the current element "Grapes" is displayed.

PHP Topics


Ask Questions

Ask Question