Hello I use this curl for site http://ip-whois.net but if I debug in my local comp I harcode $ip = "176.241.128.140"; - this my ip that I was given by my provider and I have $out = false, why ??? echo curl_error ($curl); = "Empty reply from server". I try this site http://www.ip-whois.net/ in browser and not work, what are the analogy this site who work with curl_setopt($curl, CURLOPT_URL, 'http://ip-whois.net/ip_geo.php?ip='.$ip); ? how to do this right ?:
$ip = $request->getClientIp();//I hard code $ip = "176.241.128.140"
$record = $hAid->getInfoIpCity($ip);
if ( $curl = curl_init() ) {
curl_setopt($curl, CURLOPT_URL, 'http://ip-whois.net/ip_geo.php?ip='.$ip);
curl_setopt($curl, CURLOPT_RETURNTRANSFER,true);
$out = curl_exec($curl);
$matches = array();
$country = preg_match_all("/Страна: (.*)/i", $out, $matches);
print_r($matches[1][1]);
curl_close($curl);
}