The PHP array_pop () array function ejects the last cell of the array (out of stack) _php the base

Source: Internet
Author: User
Copy Code code as follows:

<?php
/* Function Array_pop (): Eject the last cell of the array (out of stack)
* 1, Syntax: Mixed array_pop (array &array)
* 2. Description: pops up and returns the last cell of the array, minus one of the array lengths. If the array is empty (or not an array), it returns NULL.
* 3, the attention matters:
* 3.1,
*/
echo "***********************************************************************<br>";
$arr 11=array (' score 1 ' =>65, ' score 2 ' =>25, ' score 3 ' =>87, ' score 4 ' =>85, ' score 5 ' =>45, ' score 6 ' =>66);
$arr 22=array (a,b,c,d,e);
echo "Array arr11 information:";
echo "<pre>";
Print_r ($arr 11);
echo "</pre>";
$num =count ($arr 11);
for ($i =0; $i < $num; $i + +) {
echo "The last element of the array that pops up is:". Array_pop ($arr 11). <br/> ";
echo "Each time a last element pops up, the array arr11 the information:";
echo "<pre>";
Print_r ($arr 11);
echo "</pre>";
echo "<br/>";
}
?>

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.