PHP 二维数组的读出
本帖最后由 xuzuning 于 2013-03-12 19:00:37 编辑 我有一个二组数组,如下:
Array (
[119] => Array (
[exclass_id] => 119
[exclass_name] => 模板1
[store_id] => 4
[sort_order] => 1
[exclass_time] => 1363059292
[chlid] => Array (
[0] => Array (
[express_exclassid] => 119
[express_way] => 3
[express_area] => 841
[express_one] => 1
[express_onprice] => 5.00
[express_two] => 1
[express_twprice] => 4.00
[express_time] => 1363059292
)
[1] => Array (
[express_exclassid] => 119
[express_way] => 1
[express_area] => 841,721,700
[express_one] => 1
[express_onprice] => 6.00
[express_two] => 1
[express_twprice] => 5.00
[express_time] => 1363059292
)
[2] => Array (
[express_exclassid] => 119
[express_way] => 3
[express_area] =>
[express_one] => 1
[express_onprice] => 10.00
[express_two] => 1
[express_twprice] => 5.00
[express_time] => 1363059292
)
[3] => Array (
[express_exclassid] => 119
[express_way] => 1
[express_area] =>
[express_one] => 1
[express_onprice] => 10.00
[express_two] => 1
[express_twprice] => 8.00
[express_time] => 1363059292
)
[4] => Array (
[express_exclassid] => 119
[express_way] => 2
[express_area] =>
[express_one] => 1
[express_onprice] => 20.00
[express_two] => 1
[express_twprice] => 10.00
[express_time] => 1363059292
)
)
)
)
$foreach ($data as $dv){你试试。
foreach($dv as $v){
print_r($v);
}
}
foreach ($data as $dv){
foreach($dv as $v){
print_r($v);
}
}