例1
代码如下 | 复制代码 |
foreach($list as &$value){ |
例子 2,array_push() 函数
代码如下 | 复制代码 |
$a=array("Dog","Cat"); 输出: Array ( [0] => Dog [1] => Cat [2] => Horse [3] => Bird ) |
例子 3
带有字符串键的数组:
代码如下 | 复制代码 |
$a=array("a"=>"Dog","b"=>"Cat"); 输出: Array ( [a] => Dog [b] => Cat [0] => Horse [1] => Bird ) |