我的数组看起来像bleow
Array (
[number] =>
Array (
[0] => Array (
[0] => stdClass Object ( [phone_number] => 123456891 ) )
[1] => Array (
[0] => stdClass Object ( [phone_number] => 2356894156 ) ) ) )
我怎样才能使用for循环来检索phone_numbers 提前谢谢
答案 0 :(得分:1)
<?php
$arr = [
'number' => array (
'0' => array(
'0' => (object) array('phone_number'=>123456891)
),
'1' => array(
'0' => (object) array('phone_number'=>2356894156)
)
)
];
foreach($arr as $val){
foreach($val as $val1){
foreach($val1 as $val2){
echo $val2->phone_number."<br>";
}
}
}
?>