我试图将JSON字符串解码为数组,但我收到以下错误.
致命错误:不能在第6行的C:\ wamp\www\temp\asklaila.php中使用stdClass类型的对象作为数组
这是代码:
<?php
$json_string = 'http://www.domain.com/jsondata.json';
$jsondata = file_get_contents($json_string);
$obj = json_decode($jsondata);
print_r($obj['Result']);
?>
Run Code Online (Sandbox Code Playgroud)