Skip to content

array_pop ​

php
mixed array_pop (array &$tablica)
PHP

Returns the last value in $tablica and removes it from the array, reducing the number of elements by one.

Example:

php
$stos = array("orange", "banana", "apple", "raspberry");
$owoc = array_pop($stos);

print('The value removed from the array is: '.$owoc);

Result:

The value removed from the array is: raspberry