If you visit your target URL you will notice the JSON value is wrapped in a
callback method which you could trim as by something like
$json = str_replace('finance_charts_json_callback(', '', substr($pageContent, 0, strlen($pageContent) - 1));
Here is how it looks all put together:
<?php
$json_url = "http://chartapi.finance.yahoo.com/instrument/1.0/AAPL/chartdata;type=quote;range=5d/json"; $pageContent = file_get_contents($json_url);
$json = str_replace('finance_charts_json_callback(', '', substr($pageContent, 0, strlen($pageContent) - 1));
$data = json_decode($json, TRUE);
echo "<pre>"; print_r($data); echo "</pre>";