Tutorial Detect Location by IP

Returns "City, State" if found otherwise the default set at the top. function detect_city($ip) { $default = 'U...

Returns "City, State" if found otherwise the default set at the top.
function detect_city($ip) {

$default = 'UNKNOWN';

if (!is_string($ip) || strlen($ip) < 1 || $ip == '127.0.0.1' || $ip == 'localhost')
$ip = '8.8.8.8';

$curlopt_useragent = 'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2) Gecko/20100115 Firefox/3.6 (.NET CLR

Hot in Week

Popular

Archive

item