我有以下代码,它给了我一个查询生成,我需要它是走数组(php foreach)来查询数据。 我尝试使用经典的foreach(php),但我foreach抛出一个错误。 提前谢谢......
Array (
[0] => stdClass Object
(
[_new] =>
[_attributes] => Array
(
[id] => 36
[nombre] => Diana
[estado] => 1
)
[_related] => Array
(
)
[_c] =>
[_pk] => 36
[_alias] => t
[_errors] => Array
(
)
[_validators] =>
[_scenario] => update
[_e] =>
[_m] =>
)
[1] => stdClass Object
(
[_new] =>
[_attributes] => Array
(
[id] => 1
[geoCode] => MAX
)
[_related] => Array
(
)
[_c] =>
[_pk] => 1
[_alias] => t
[_errors] => Array
(
)
[_validators] =>
[_scenario] => update
[_e] =>
[_m] =>
))
当我走路或转换为阅读时?
<?php foreach ($response as $value) {echo $value->nombre;} ?>