|
|
Php Last Array Element Delete Function
|
Tutorials » Php »
|
Topic |
What is array_pop Function?
|
|
Explanation |
|
The "array_pop" function is used to delete the last element of an array.
Syntax:
array_pop(array)
In the above syntax "array" specifies the array from which the last element is to be deleted.
Example
<?php
$b=array("c"=>"Cherry","b"=>"Strawberry", "d"=>"Berry");
$pop = array_pop($b);
print_r($b);
?>
Result:
Array
(
[c] => Cherry
[b] => Strawberry
)
In the above example the last element of the array "Berry" is deleted.
|
|
A Note |
Learn PHP programming language tutorial with simple and neat example. Hope you enjoy this free tutorial.
Do give us your valuable feedback and suggestions on this online tutorial. This is a Copyright Content.
|
|
|
|