Sto cercando di importare dei dati tramite JSON, se inserisco il codice direttamente nel file PHP funziona tutto, se invece cerco di importare dall'url mi da un errore. Penso che sia dato dal fatto che in codice è chiuso tra [ ].


codice:
[ { 
    "country" : [ "Italy" ],
    "rating_count" : 221,
    "release_date" : 19791116,
    "year" : 1980
  } ]

Codice PHP:
$url 'http://example.com/?id=' $id;
$json file_get_contents($url);

$obj json_decode($json); 
Come faccio a togliere le prime parentesi quadre?