<pre>
array(5) { [0]=> array(2) { ["name"]=> string(10) "name_print" ["value"]=> string(5) "22222" }
[1]=>array(2) { ["name"]=> string(6) "hem_up" ["value"]=> string(0) "" } [2]=> array(2)
{ ["name"]=>string(13) "hem_up_double" ["value"]=> string(1) "0" } [3]=> array(2)
{ ["name"]=> string(11) "hem_up_size" ["value"]=> string(1) "0" } [4]=> array(2)
{ ["name"]=> string(11) "waist_catch" ["value"]=> string(0) "" } }
</pre>
我在PHP中的json_decode之后得到了这样一个数组。但我希望得到一个像这样的关联数组:
array("name_print"=>22222, "hem_up"=>555, ...}
答案 0 :(得分:0)
$out = array();
foreach ($in as $i) {
$out[$i['name']] = $i['value'];
}