php 数组插入元素

 

<?php
$a=array("red","green");
array_push($a,"blue","yellow");
print_r($a);
?>

输出

Array ( [0] => red [1] => green [2] => blue [3] => yellow )

 

 

参考:

https://www.w3school.com.cn/php/php_ref_array.asp

posted @ 2019-07-29 01:48  anobscureretreat  阅读(526)  评论(0编辑  收藏  举报