drza10046
2014-11-23 23:50
浏览 124
已采纳

如何从数组中回显数据?

I have this array

Array
(
[first_information] => Array
    (
        [0] => 10
        [1] => 12
    )

[rows] => 1
[0] => Array
    (
        [data_1] => 1
        [data_2] => 2
        [data_3] => 3
        [data_4] => 4
        [data_5] => 5
    )

)

How am I supposed to show only the [first_information] content's.

I have tried with this code

foreach($row['first_information'] as $first)  
   echo $first; 

But shows only '12' which is the second element of the array.

Thank you in advance.

图片转代码服务由CSDN问答提供 功能建议

我有这个数组

  Array 
(
  [first_information] =>数组
(
 [0] => 10 
 [1] => 12 
)
 
 [rows] => 1 
 [0] => 数组
(
 [data_1] => 1 
 [data_2] => 2 
 [data_3] => 3 
 [data_4] => 4 
 [data_5] => 5 \  n)
   
 
 

我应该如何仅显示[first_information]内容。

我尝试使用此代码

  foreach($ row ['first_information']为$ first)
 echo $ first;  
   
 
 

但只显示“12”,这是数组的第二个元素。

提前谢谢。

  • 写回答
  • 好问题 提建议
  • 追加酬金
  • 关注问题
  • 邀请回答

1条回答 默认 最新

相关推荐 更多相似问题