array_pop() function in php
0 2705
array_pop() function of PHP is used to remove the last item of an array. It is an inbuilt function of PHP.
Syntax:
array_pop($arr);
Here
$arr is a php array.
Example:
<?php $arr1 = array("fruit1"=>"apple","fruit2"=>"banana","fruit3"=>"orange"); echo "<pre>"; echo "Before apply array_pop() function <br>"; print_r($arr1); array_pop($arr1); echo "<br> After apply array_pop() function"; print_r($arr1); ?>
Output:
Share:
Comments
Waiting for your comments