int array_push ( array &$arr , mixed $value1 [, mixed $value2, mixed $value3 ... ] )
引數說明:<?php $num = array(10, 45, 9); array_push($num, 100, 6); //在陣列開頭插入元素 print_r($num); $info = array("name"=>"C語言中文網", 4=>"PHP教學"); array_push($info, "http://c.biancheng.net/php/", "8年"); print_r($info); ?>執行以上程式的輸出結果為:
Array
(
[0] => 10
[1] => 45
[2] => 9
[3] => 100
[4] => 6
)
Array
(
[name] => C語言中文網
[4] => PHP教學
[5] => http://c.biancheng.net/php/
[6] => 8年
)