dplbf4340 2013-11-11 08:24
浏览 125
已采纳

在php中读取json输出

how to read below json data in php?
i have "$json = json_decode($data,true); and i tryied "$json->{'screenShareCode'};" but is is giving me an error? :(


    array(5) {
      ["screenShareCode"]=>
      string(9) "887874819"
      ["appletHtml"]=>
      string(668) ""
      ["presenterParams"]=>
      string(396) "aUsEdyygd6Yi5SqaJss0="
      ["viewerUrl"]=>
      string(65) "http://api.screenleap.com/v2/viewer/814222219?accountid=myid"
      ["origin"]=>
      string(3) "API"
    }

  • 写回答

4条回答 默认 最新

  • duanpei8518 2013-11-11 08:26
    关注

    Your output is regular array not JSON, so you access it as regular PHP array:

    $x = $array['screenShareCode']
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(3条)

报告相同问题?