检索对象(stdClass)#2中的数据

时间:2013-10-13 15:49:48

标签: php html

object(stdClass)#1 (3) { ["status_code"]=> int(200) ["status_txt"]=> string(2) "OK" ["data"]=> 
object(stdClass)#2 (5) { ["long_url"]=> string(18) "http://google.com/" ["url"]=> string(21) "http://bit.ly/17A2GVj" ["hash"]=> string(7) "17A2GVj" ["global_hash"]=> string(6) "3j4ir4" ["new_hash"]=> int(0) } }

我如何循环这个?我想得到[“哈希”]

2 个答案:

答案 0 :(得分:1)

foreach $objects as $object
{
   $result[] = $object['data']
}

的var_dump($结果);

答案 1 :(得分:0)

$yourObjectVariable->data->hash