掌握PHP中数组遍历的语法结构 示例如下
$cars = []; //购物车的数组 遍历
$cars['手机'] = '1000';
$cars['电视'] = '500';
$cars['冰箱'] = '1560';
$cars['洗衣机'] = '2200';
$cars[] = '2200';
$cars[] = '4351';
$cars[] = '543';
foreach($cars as $k => $v){
echo $k . '---' . $v . '<br>';
}