mixed array_pop ( array &$arr )
引數 arr 表示要處理的陣列。<?php $num = array(45, 10, 6, 9, 100); array_pop($num); //刪除陣列末尾的元素 print_r($num); $info = array( "name" => "C語言中文網", 4=>"PHP教學", "http://c.biancheng.net/php/", "8年"); array_pop($info); print_r($info); ?>執行結果:
Array
(
[0] => 45
[1] => 10
[2] => 6
[3] => 9
)
Array
(
[name] => C語言中文網
[4] => PHP教學
[5] => http://c.biancheng.net/php/
)