$url, CURLOPT_RETURNTRANSFER => true, CURLOPT_TIMEOUT => intval($timeout), CURLOPT_HEADER => false ); // We assume nobody's going to try to overwrite the settings above array_merge($curl_options,$settings_array); if (!$curl_open = curl_init()) { $return = false; } curl_setopt_array($curl_open, $curl_options); $return = curl_exec($curl_open); curl_close($curl_open); // Close CURL } elseif (function_exists("passthru")) { $cmd = "curl -m $timeout -s-url ".$url; // Set up command ob_start(); passthru($cmd, $status); // Run command $return = ob_get_contents(); // Put everything into the variable ob_end_clean(); if ($status > 1) { return false; } } return $return; }