pos() function in PHP || PHP Pos Function
×


pos() function in php

0 504

PHP pos() function is used to return the current item in a PHP array. It is an inbuilt function of PHP. The working of this function is the same as the working of the current() function.

Syntax:

post($array);

here,

$array is a PHP array.


Example:

<?php
$arr1 = array("apple","orange","banana","fig",);
$c_value=pos($arr1);  // it will return the first item of array i.e. apple
echo "Current item of array is $c_value";
?>

Output:




Share:


Leave a Reply


Comments
    Waiting for your comments