Home > Article > Backend Development > php Array数组转换有关问题
php Array数组转换问题
如何把
<br />Array<br />(<br /> [strwarenum] => Array<br /> (<br /> [0] => 1<br /> [1] => 1<br /> )<br /><br /> [strwareid] => Array<br /> (<br /> [0] => 80<br /> [1] => 79<br /> )<br /><br />)
<br />Array<br />(<br /> [config_id] => <br /> [strwareid] => ,78,80<br /> [strwarenum] => ,1,1<br /> [config_name] => <br /> [config_desc] => <br /> [diycat_id] => <br />)
foreach($b as $k => $v){<br /> $a[$k][]='';<br /> $v=array_reverse($a[$k]);<br />}<br />var_export($b);<br />
$arr=你的数组;<br />foreach($arr as &$v){<br /> if(is_array($v)) $v=','.join(',',$v);<br />}<br />print_r($arr);