array_pop() function in php || array pop function in php
×


array_pop() function in php

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:




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