可捕获的致命错误:类stdClass的对象无法转换为字符串

roh*_*ora 4 php json

我正在从php转换数组到json json_encode().如果我为一个数组编码它我可以解码它,但是当它是这样的:array('a'=>array(0=>array(),1=>array()))它返回{"a":[[],[]]}

当我解码它时,我得到以下错误

Catchable fatal error: Object of class stdClass could not be converted to string
Run Code Online (Sandbox Code Playgroud)

json来源

json在这里

Yog*_*har 11

使用true如在第二参数json_decode

$arr = json_decode($your_array,true); // it will create array
Run Code Online (Sandbox Code Playgroud)

工作示例http://codepad.viper-7.com/0Dxxm8