Почему curl возвращает 1 хотя параметр CURLOPT_RETURNTRANSFER установлен
this is the servers array that I keep top level domain names and extensions protected $servers = array( "com.tr" => "whois.nic.tr", "gen.tr" => "whois.nic.tr", "web.tr" => "whois.nic.tr", "k12.tr" => "whois.nic.tr", "org.tr" => "whois.nic.tr" );
Что я уже пробовал:
I am required to get whois info so I wrote this function function whois($domain,$ext) { $server=$this->servers[$ext]; $domain=$domain.".".$ext; if (function_exists('curl_version')) { $curl = curl_init(); curl_setopt($curl, CURLOPT_URL, $server); curl_setopt($curl, CURLOPT_PORT, 43); curl_setopt($curl, CURLOPT_RETURNTRANSFER, true); curl_setopt($curl, CURLOPT_TIMEOUT, 5); curl_setopt($curl, CURLOPT_CUSTOMREQUEST, $domain."\r\n"); $result = curl_exec($curl); curl_close($curl); echo print_r($result); } else { trigger_error('cURL is not found!'); exit(); } } I am using this way whois("google","com"); This function works for google.com and It gives me the correct domain information But when I execute for google.org.tr then (this is the intersting part) sometimes retuns No match found for "google.org.tr"(whis is expected) and somethimes return "1"