PHP array_pop()


array_pop() returns the last element of an array, at the same time delete the element from the array.

<?PHP
	$arr=array(1,2,3,4,5,6,7,8,9);
    $ret=array_pop($arr);
	echo "$ret";  //9
	foreach($arr as $element) echo "$element, ";  //1, 2, 3, 4, 5, 6, 7, 8,
?>