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
