I am trying to decode a JSON file in PHP (which I do all the time). But when I try and use this file: https://www.hyzyne.co.nz/updatewlg/nzta.json . It decodes it but then only shows the last part of the JSON in the array.
PHP:
$xml = file_get_contents('https://www.hyzyne.co.nz/updatewlg/nzta.json');
$data = json_decode($xml, true);
print_r($data);
If you view the file you will see it is quite long.
When I print the above all I get is:
Array ( [data] => Array ( [0] => Array ( [roadevent] => Array ( [alternativeRoute] => Follow Detours [directLineDistance1] => 1.55 km southeast of Taradale [directLineDistance2] => 1.62 km southwest of Jervoistown [directLineDistance3] => 1.66 km east of Waiohiki [endDate] => 2013-12-03T18:25:18.677+13:00 [eventComments] => Now Clear [eventDescription] => Crash [eventId] => 84295 [eventIsland] => North Island [eventType] => Road Hazard [expectedResolution] => Until further notice [impact] => Caution [locationArea] => SH 50 Taradale [locations] => Array ( [location] => 050-0005/04.88 Taradale ) [planned] => false [startDate] => 2013-12-03T17:17:00.000+13:00 [status] => Resolved [wktGeometry] => SRID=27200;POINT (2841479.57385071 6176775.805777006) [eventCreated] => 2013-12-03T17:20:18.450+13:00 [eventModified] => 2013-12-03T18:25:18.380+13:00 [informationSource] => Police [supplier] => Official [eventRegions] => Array ( [eventRegion] => Taranaki, Manawatu-Wanganui, Hawke's Bay & Gisborne Region ) ) ) ) )
Which is not all of the JSON, I did make the JSON file myself. But I am unable to recognise any problems in the JSON.
Even when putting my JSON through http://jsonlint.com/ I only get the last segment. Does anyone know what I am doing wrong?
Thanks