Can't read JSON using file_get_contents
<p>I'm getting null (blank page) from this:</p>

<p>api.php code:</p>

<pre><code>$json_data = array(
    'status' =&gt; 'failed',
    'version' =&gt; '0.0.5'
);
header("Content-type: application/json");
echo json_encode($json_data, JSON_PRETTY_PRINT);
</code></pre>

<p>getapi.php code:</p>

<pre><code>$json_file = file_get_contents("http://domain.com/api.php");
$json_data = json_decode($json_file);
print_r($json_data);



    $json_file = file_get_contents("http://domain.com/api.php");
echo $json_file; //{"status":"failed","version":"0.0.5"}
    $json_data = json_decode($json_file);
    print_r($json_data); // blank page
</code></pre>