Notice: Trying to get property of non-object problem

来源:互联网 发布:mysql as 编辑:程序博客网 时间:2024/04/29 21:49

<?php
$json_string='{"docid":"8F24","topicid":"084Q","flag":
"行情类"}';
$jsons=json_decode($json_string);
echo $jsons->docid;
echo $jsons->flag;

?>

json中出现中文 就提示:Notice: Trying to get property of non-object problem

解决办法把代码另存为utf-8就可以了

原创粉丝点击