I’ve got problem with using Json from : http://api.justin.tv/api/stream/list.json?channel=Herdyn , I need get some information about Live Stream.
My code :
<?php
$json = file_get_contents('http://api.justin.tv/api/stream/list.json?channel=Herdyn');
$obj = json_decode($json);
echo $obj->{'name'};
?>
When i upload it on server : http://blx.patrikpapso.com/herdyn/ , no error, just blank page, don’t know what to do…
Do
var_dump($obj);and you will see that there is no property “name”. The JSON is an array that contains an object with such a property:or even
There is supposed to be at least an E_NOTICE though.