php 数组操作
<?php $arr = array('A','B','C'); echo 'init $arr <br/>'; var_dump($arr);//array(3) { [0]=> string(1) "A" [1]=> string(1) "B" [2]=> string(1) "C" } echo '</br>'; echo 'unshift after <br/>'; array_unshift($arr,'E','F');//array(5) { [0]=> string(1) "E" [1]=> string(1) "F" [2]=> string(1) "A" [3]=> string(1) "B" [4]=> string(1) "C" } var_dump($arr);// echo '</br>'; echo 'push after <br/>'; array_push($arr,'G','H');//array(7) { [0]=> string(1) "E" [1]=> string(1) "F" [2]=> string(1) "A" [3]=> string(1) "B" [4]=> string(1) "C" [5]=> string(1) "G" [6]=> string(1) "H" } var_dump($arr); echo '</br>';