php 访问以数字开头或带连字符 '-' 的对象属性

$string = '{"tmallDelivery":"true","3plTiming":"false","deliveryCps":24}';
$t = json_encode($string);
$t = json_decode($t);
var_dump($t);
if($t->tmallDelivery && $t->{"3plTiming"} && !empty($t->deliveryCps))
{
echo 123;
}

{" "} 亲测可用
posted @ 2018-05-18 15:11  year12  阅读(387)  评论(0编辑  收藏  举报