$url = 'xxxxxxxxx';
$result = file_get_contents($url);
$stuff = json_decode($result, true);
if (false !== ($contents = $stuff)) {
echo $contents;
} else {
//do nothing
}
If query doesnt return any result, I want to show nothing
Instead I am getting
Warning: file_get_contents(xxxx) [function.file-get-contents]:
failed to open stream: HTTP request failed! HTTP/1.0 400 Bad Request in /home/xxxxx/xxx.php on line 4