《?php$arr=array();//例子1
$json_str= '{"ret":"OK","questions":{
"1":{"qid":"1","title":"\u95ee\u98981111",
"answers":{
"1":{"cid":"1","title":"A","cont":"\u7b54\u68481-1","iscorrect":"1","qid":"1"},
"2":{"cid":"2","title":"B","cont":"\u7b54\u68481-2","iscorrect":"0","qid":"1"},
"3":{"cid":"3","title":"C","cont":"\u7b54\u68481-3","iscorrect":"0","qid":"1"}
}},
"2":{"qid":"2","title":"\u95ee\u98982222",
"answers":{"5":{
"cid":"5","title":"A","cont":"\u7b54\u68482-1","iscorrect":"0","qid":"2"},
"6":{"cid":"6","title":"B","cont":"\u7b54\u68482-2","iscorrect":"0","qid":"2"},
"7":{"cid":"7","title":"A","cont":"aa","iscorrect":"0","qid":"2"},
"8":{"cid":"8","title":"D","cont":"\u7b54\u68482-4","iscorrect":"0","qid":"2"}}}}}';//相关错误反馈
// Notice: Undefined offset: 1
// Notice: Trying to get property of non-object
// Notice: Undefined offset: 0
// Notice: Array to string conversion
//json_decode不加参数true,转成的就不是array,而是对象 [questions] => stdClass Object
$arr=json_decode($json_str,true);//echo "