标签:var 合并 pytho array php 数组 python c++ die
$arr1 = array("a"=>"PHP","b"=>"java","python");
$arr2 = array("c" =>"ruby","d" => "c++","go","a"=> "swift");
$arr3 = array_merge($arr1,$arr2);
$arr4 = $arr1 + $arr2;
var_dump($arr3);
var_dump($arr4);die;
输出:
array(6) { ["a"]=> string(5) "swift" ["b"]=> string(4) "java" [0]=> string(6) "python" ["c"]=> string(4) "ruby" ["d"]=> string(3) "c++" [1]=> string(2) "go" }
array(5) { ["a"]=> string(3) "PHP" ["b"]=> string(4) "java" [0]=> string(6) "python" ["c"]=> string(4) "ruby" ["d"]=> string(3) "c++" }
标签:var 合并 pytho array php 数组 python c++ die
原文地址:https://www.cnblogs.com/chxrs/p/10472341.html