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

php array_pop() array function pops (pops) the last unit of the array_PHP tutorial

WBOY
WBOYOriginal
2016-07-21 15:26:491078browse

Copy code The code is as follows:

/*Function array_pop(): Pop the last unit of the array ( Pop)
* 1. Syntax: mixed array_pop (array &array)
* 2. Description: Pop and return the last unit of the array array, and reduce 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,'score 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 "Pop one at a time After the last element, the information of array arr11: ";
echo "
"; <br>print_r($arr11); <br>echo "
";
echo "< br />";
}
?>

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/323848.htmlTechArticleCopy the code as follows: ?php /*Function array_pop(): Pop the last unit of the array (pop off the stack) * 1. Syntax: mixed array_pop (array lt;br"; $arr11=array('score 1'=65,'score 2'...
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