$t循环中的JSON php
从JSON我得到:$t循环中的JSON php,php,json,Php,Json,从JSON我得到: stdClass Object ( [$t] => 2011-12-12T13:00:00.000Z ) 我如何使用PHP获取此日期 我试过: feed->item->'$t'但这不起作用…这应该起作用: $t = $feed->item->{'$t'}; 当心: 这只适用于单引号,因为PHP对带有双引号的字符串进行变量插值。您需要使用{}以这种方式获取属性 $feed->item->{'$t'} 尝试: {$notation}允许您使用v
stdClass Object ( [$t] => 2011-12-12T13:00:00.000Z )
我如何使用PHP获取此日期
我试过:
feed->item->'$t'
但这不起作用…这应该起作用:
$t = $feed->item->{'$t'};
当心:
这只适用于单引号,因为PHP对带有双引号的字符串进行变量插值。您需要使用
{}
以这种方式获取属性
$feed->item->{'$t'}
尝试:
{$notation}
允许您使用vars作为对象名。我还发现使用数组json\u decode($json,true)
更容易。在这种情况下,属性实际上是'$t'
。可能是
$item = $feed->item->{$t};