I have a json file from import.io that returns null when decoded, but shows up as a string when encoded and is all there. How can I "loop" through a json string in PHP?
Json data is very lengthy so I refrained from posting it.
Json: https://codeshare.io/2BD4ma
Code:
<?php
$jsonFile = file_get_contents('feeds/quotes.json');
//decode
$results = json_encode($jsonFile, TRUE);
var_dump($results);
?>
It would be nice to see the code you are using, or have tried....
Either way, you need to use
json_decodeon the JSON object, which will turn it into a PHP array: