日期:2014-05-17 浏览次数:20540 次
foreach($a as $k=>$v)
{
print_r($newarr);
echo $a[$k]['5'].'<br />';
}
Array
(
[0] => Array
(
[lotno] => 3206
[count] => 12
)
[1] => Array
(
[lotno] => 3207
[count] => 63
)
[2] => Array
(
[lotno] => 3218
[count] => 180
)
)
120
Array
(
[0] => Array
(
[lotno] => 3206
[count] => 12
)
[1] => Array
(
[lotno] => 3207
[count] => 63
)
[2] => Array
(
[lotno] => 3218
[count] => 180
)
)
135
$ar = array (
array( 'lotno' => 3206, 'count' => 12 ),
array( 'lotno' => 3207, 'count' => 63 ),
array( 'lotno' => 3218, 'count' => 180 ),
);
$s = '';
$n = 0;
foreach($ar as $r) {
if($n + $r['count'] > 120) {
echo $s . $r['lotno'] . '*' . (120-$n) ."\n";
echo $r['lotno'] . '*' .&nbs