https://www.googleapis.com/freebase/v1/mqlread/?lang=/lang/en&query=[{%20%22id%22:%20null,%20%22name%22:%20null,%20%22id|=%22:%20[%20%22/m/01w7nww%22,%22/m/01fm07%22,%22/m/022c7z%22,%22/m/0gywn%22%20]%20}] Json Result. I would like to print all Name values. Thanks
Then you have a problem somewhere try adding error_reporting(E_ALL) at the top of your code (after <?php) I've tried this <pre> <?php // extension=php_openssl.dll $url = 'https://www.googleapis.com/freebase/v1/mqlread/?lang=/lang/en&query=[{%20%22id%22:%20null,%20%22name%22:%20null,%20%22id|=%22:%20[%20%22/m/01w7nww%22,%22/m/01fm07%22,%22/m/022c7z%22,%22/m/0gywn%22%20]%20}]'; print_r(json_decode(file_get_contents($url))); ?> Code (markup): and the result is stdClass Object ( [result] => Array ( [0] => stdClass Object ( [name] => Soul music [id] => /m/0gywn ) [1] => stdClass Object ( [name] => Neo soul [id] => /m/01fm07 ) [2] => stdClass Object ( [name] => Beat [id] => /m/022c7z ) [3] => stdClass Object ( [name] => Erykah Badu [id] => /m/01w7nww ) ) ) Code (markup): So this should work! and if you want to print the names you can loop the array for example: <?php $url = 'https://www.googleapis.com/freebase/v1/mqlread/?lang=/lang/en&query=[{%20%22id%22:%20null,%20%22name%22:%20null,%20%22id|=%22:%20[%20%22/m/01w7nww%22,%22/m/01fm07%22,%22/m/022c7z%22,%22/m/0gywn%22%20]%20}]'; $code = json_decode(file_get_contents($url)); if (isset($code['result']) && count($code['result']) > 0) { foreach ($code['result'] AS $k=>$v) { echo $v['name'] . "<br />"; } } ?> Code (markup):