Read a JSON file with php

Get the JSON content using file_get_contents() and to not avoid warnings specify the sources:

To read the file with an http request specify http/https:

To read the file form the filesystem:

decode the JSON using json_decode():

Use var_dump or print_r to understand the data structure. If for example the data content is:

To print the database name of databaseOne:

To loop through the array:

To print the database name for each entries:

huckbit

Programmer by day and mostly by night as well.