$idps = array (); $URL = '/InAcademia/se.json'; $countryJSON = file_get_contents($URL); $idpList = json_decode($countryJSON, true); foreach ($idpList as $hint => $idp) { $name = $idp['en']; $idps[$name] = $hint; }