// json data ;[ { name: 'Aragorn', race: 'Human', }, { name: 'Legolas', race: 'Elf', }, { name: 'Gimli', race: 'Dwarf', }, ] $url = 'data.json'; // path to your JSON file $data = file_get_contents($url); // put the contents of the file into a variable $characters = json_decode($data); // decode the JSON feed