-2

代码:

foreach ($output as $result)
print_r($result);

下面是我上面代码的输出:

Array ( [0] => 323 [1] => 323 [2] => 323 [3] => 323 [4] => 65 [5] => 65 [6] => 65 [7] => 65 [8] => 121 [9] => 121 [10] => 121 [11] => 121 ) 
Array ( ) 
Array ( ) 
Array ( [0] => 656 [1] => 656 [2] => 656 [3] => 656 ) 
Array ( [0] => 777 [1] => 777 [2] => 777 [3] => 777 ) 
Array ( [0] => 321 [1] => 321 [2] => 321 [3] => 321 [4] => 434 [5] => 434 [6] => 434 [7] => 434 [8] => 400 [9] => 400 [10] => 400 [11] => 400 ) 
Array ( ) 
Array ( ) 
Array ( [0] => 300 [1] => 300 [2] => 300 [3] => 300 [4] => 666 [5] => 666 [6] => 666 [7] => 666 ) 
Array ( )
Array ( [0] => 167 [1] => 167 [2] => 167 [3] => 167 )

我想分别打印每个数组。尝试嵌套foreach循环但没有获得所需的输出。

请帮忙

4

1 回答 1

0

嵌套循环很简单

foreach ($output as $outer)
{
  foreach ($outer as $inner)
  {
    print_r($inner);
  }
}
于 2013-04-05T06:16:38.797 回答