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


pos() function in php

1961

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:




Best WordPress Hosting


Share:


Discount Coupons

Get a .COM for just $6.98

Secure Domain for a Mini Price



Leave a Reply


Comments
    Waiting for your comments