Home >Backend Development >PHP Tutorial >javascriptarray php array_pop array function pops the last unit of the array (pops the stack)

javascriptarray php array_pop array function pops the last unit of the array (pops the stack)

WBOY
WBOYOriginal
2016-07-29 08:46:031259browse

Copy code The code is as follows:


/*Function array_pop(): Pop the last unit of the array (pop off the stack)
* 1. Syntax: mixed array_pop (array &array)
* 2 , Description: Pops and returns the last element of the array array, and decrements the length of the array array by one. NULL will be returned if array is empty (or not an array).
* 3. Notes:
* 3.1,
*/
echo "************************************ ****************************************
";
$arr11=array( 'Grade 1'=>65,'Grade 2'=>25,'Grade 3'=>87,'Grade 4'=>85,'Grade 5'=>45,'Grade 6'= >66);
$arr22=array(a,b,c,d,e);
echo "Information of array arr11:";
echo "

"; <br>print_r($arr11); <br>echo "
";
$num=count($arr11);
for($i=0;$i<$num;$i++){
echo "The last element of the popped array is:". array_pop($arr11)."
";
echo "Every time the last element is popped, the information of array arr11:";
echo "
"; <br>print_r($arr11); <br> echo "
";
echo "
";
}
?>

The above introduces the javascriptarray php array_pop array function to pop (pop) the last unit of the array, including the content of javascriptarray. I hope it will be helpful to friends who are interested in PHP tutorials.

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn