Organizational Research By

Surprising Reserch Topic

Experts Most Trusted Topic


json decode to array


json decode to array  using -'php,json'

I am trying to decode a JSON string into an array but i get the following error.


  Fatal error: Cannot use object of type
  stdClass as array in
  C:\wamp\www\temp\asklaila.php on line
  6


Here is the code:

<?php
$json_string = 'http://www.domain.com/jsondata.json';

$jsondata = file_get_contents($json_string);
$obj = json_decode($jsondata);
print_r($obj['Result']);
?>

    

asked Sep 15, 2015 by NanHunley
0 votes
11 views



Related Hot Questions



Government Jobs Opening


...