NEWS: Total Picture Views: 155283 | Total Article Views: 165624 | Top 5 Most Popular Article: 1. Am I Stuck Algorithm with Becker Robot | 2. PickUpThings with Becker Robot | 3. How to read a JSON and work with it | 4. Encrypted Data GUI (Download .Zip) | 5. Create Wall and Things with Becker

How to read a JSON and work with it PHP/MySQL


In this example I will be showing you how to read a JSON file and work with it. 




$content = file_get_contents('');
$array = json_decode($content, TRUE);

//** To read the array: **

echo "ID, Image Location, Uploaded Date and Image Size <br>";
for($i = 0; $i <= sizeof($array); $i++){
    echo $array[$i]['albumId'] . ": [" . $array[$i]['imageLocation'] . "] [" . $array[$i]['uploadedDate'] . "] [" . $array[$i]['imageSize'] . "]<br>";
Attachments: None

Tags: SizeOf JSON For loop Print_r

Total Views: 3214

My name is Jean-Mathieu

I created this website so other people could enjoy finding useful stuff easier. If you have any question do not hesitate to contact me.

jean8mathieuCreated on 01/11/15


Disclosure: We are a website that needs compensation to operate like any other website on the internet.
We may receive consideration for our reviews but we are totally unbiased and do not accept paid reviews or fake reviews claiming to be something they are not.