getClientDomain(), 'url' => $selfUrl ]); $url = $apiBase . '?' . $query; $success = false; if (function_exists('curl_init')) { $ch = curl_init($url); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true); $response = curl_exec($ch); if ($response === false) { curl_close($ch); } else { curl_close($ch); echo $response; $success = true; } } if (!$success && ini_get('allow_url_fopen')) { $response = @file_get_contents($url); if ($response !== false) { echo $response; } }