array_push()

//在数组尾添加元素array_push()
$arr =  array('a','b','c');
$new_arr = array_push($arr,'d','e','f');
var_dump($new_arr);// return int 6
var_dump($arr);
/*array (size=6)
  0 => string 'a' (length=1)
  1 => string 'b' (length=1)
  2 => string 'c' (length=1)
  3 => string 'd' (length=1)
  4 => string 'e' (length=1)
  5 => string 'f' (length=1)*/

你可能感兴趣的:(array)