我需要一些帮助。
我有变量$ result。 如果我打印它,我会:
echo "<PRE>";print_r($result);
stdClass Object
(
[return] => Array
(
[0] => stdClass Object
(
[field1] => value1
[field2] => value2
[field3] => value3
)
[1] => stdClass Object
(
[field1] => value1
[field2] => value2
[field3] => value3
)
etc...
我需要使用foreach来逐字段打印,例如:
foreach ($result as $key)
echo $key->field1;
但它不起作用......
我怎么能这样做? 感谢