PHP Programing language

array_pop() Function in PHP
Previous Home Next

array_pop()

The array_pop() function deletes the last element of an array.

Syntax:
array_pop(array)

Example:

<?php
$a=array("Apple","Banana","Orange");
array_pop($a);
print_r($a);
?>

Output:

Array ( [0] => Apple [1] => Banana )

Previous Home Next