X
HOME HTML CSS JAVASCRIPT SQL PHP JQUERY ANGULAR BOOTSTRAP XML ASP.NET MORE...
REFERENCES | EXAMPLES | FORUM | ABOUT

PHP array_pop() Function

PHP Array Reference PHP Array Reference

Example

Delete the last element of an array:

<?php
$a=array("red","green","blue");
array_pop($a);
print_r($a);
?>

Run example »

Definition and Usage

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


Syntax

array_pop(array)

Parameter Description
array Required. Specifies an array

Technical Details

Return Value: Returns the last value of array. If array is empty, or is not an array, NULL will be returned.
PHP Version: 4+


PHP Array Reference PHP Array Reference

Your suggestion:

Close [X]

Thank You For Helping Us!

Your message has been sent to W3Schools.

Close [X]
Search w3schools.com:

WEB HOSTING

UK Reseller Hosting

WEB BUILDING

Download XML Editor FREE Website BUILDER Free HTML5 Templates

SHARE THIS PAGE

facebook