我有一个数组:
$array1=['0'=>'field_1','1'=>'field_2'];
我期望的输出结果到我的新数组:
$newarray=['field_1'=>field1_val,'field_2'=>field2_val];
我尝试该代码:
$newarray=array();
foreach($array1 as $value){
$newarray[] = $value;
}
print_r($newarray);
但它似乎不起作用。任何人都可以帮助我吗?
慕雪6442864
牧羊人nacy