PHP完全自学手册(珍藏版) 中文pdf扫描版下载
注意红色部分!
(
[0] => stdClass Object ( [countOrder] => 3 [amntTotal] => 2380.00 [name] => 测试版 )
[1] => stdClass Object ( [countOrder] => 1 [amntTotal] => 2380.00 [name] => VIP版 )
[2] => stdClass Object ( [countOrder] => 2 [amntTotal] => 4760.00 [name] => 个人版 )
)
$order_length = sizeof($order_data_info);
for($i=0;$i<$order_length;++$i)
{
$order_data_info[$i]->amntTotal = money($order_data_info[$i]->amntTotal);
}
print_r($order_data_info);
Array
(
[0] => Array ( [countOrder] => 3 [amntTotal] => 2380.00 [name] => 测试版 )
[1] => Array ( [countOrder] => 1 [amntTotal] => 2380.00 [name] => VIP版 )
[2] => Array ( [countOrder] => 2 [amntTotal] => 4760.00 [name] => 个人版 )
)
$order_length = sizeof($order_data_info);
for($i=0;$i<$order_length;++$i)
{
$order_data_info[$i]['amntTotal'] = money($order_data_info[$i]['amntTotal']);
}
print_r($order_data_info);
Array(
[0] => stdClass Object ( [countOrder] => 3 [amntTotal] => 2380.00 [name] => 测试版 )
[1] => stdClass Object ( [countOrder] => 1 [amntTotal] => 2380.00 [name] => VIP版 )
[2] => stdClass Object ( [countOrder] => 2 [amntTotal] => 4760.00 [name] => 个人版 )
)
$order_length = sizeof($order_data_info);
for($i=0;$i<$order_length;++$i)
{
$order_data_info[$i]->amntTotal = money($order_data_info[$i]->amntTotal);
}
print_r($order_data_info);
Array
(
[0] => Array ( [countOrder] => 3 [amntTotal] => 2380.00 [name] => 测试版 )
[1] => Array ( [countOrder] => 1 [amntTotal] => 2380.00 [name] => VIP版 )
[2] => Array ( [countOrder] => 2 [amntTotal] => 4760.00 [name] => 个人版 )
)
$order_length = sizeof($order_data_info);
for($i=0;$i<$order_length;++$i)
{
$order_data_info[$i]['amntTotal'] = money($order_data_info[$i]['amntTotal']);
}
转载请注明:谷谷点程序 » 初学手记:php二维数组循环