PHP array_pop()函数与示例
生活随笔
收集整理的这篇文章主要介绍了
PHP array_pop()函数与示例
小编觉得挺不错的,现在分享给大家,帮大家做个参考.
PHP array_pop()函数 (PHP array_pop() function)
array_pop() function is used to delete/pop last element from the array.
array_pop()函数用于从数组中删除/弹出最后一个元素。
Syntax:
句法:
array_pop(array);Here, array is the input array, function will delete last element from it.
在这里, array是输入数组,函数将从其中删除最后一个元素。
Examples:
例子:
Input://initial array is$arr = array(100, 200, 300, 10, 20, 500);//deleting elementsarray_pop($arr);array_pop($arr);array_pop($arr);Output:Array([0] => 100[1] => 200[2] => 300)PHP code to delete elements from an array using array_pop() function
PHP代码使用array_pop()函数从数组中删除元素
<?php$arr = array(100, 200, 300, 10, 20, 500);array_pop($arr);array_pop($arr);array_pop($arr);print("array after removing elements...\n");print_r($arr); ?>Output
输出量
array after removing elements... Array ([0] => 100[1] => 200[2] => 300 )翻译自: https://www.includehelp.com/php/array_pop-function-with-example.aspx
总结
以上是生活随笔为你收集整理的PHP array_pop()函数与示例的全部内容,希望文章能够帮你解决所遇到的问题。
- 上一篇: [转载] python迭代器、生成器和装
- 下一篇: ctype函数_PHP ctype_xd