Home > Uncategorized > mendeteksi negara lewat ip address

mendeteksi negara lewat ip address

source : http://www.phptutorial.info/iptocountry/the_script.html

Mendeteksi asal negara pengunjung website kita melalui ip address.

berikut ini adalah codenya:

download ip_files.

function iptocountry($ip) {
$numbers = preg_split( “/\./”, $ip);
$code=($numbers[0] * 16777216) + ($numbers[1] * 65536) + ($numbers[2] * 256) + ($numbers[3]);
foreach($ranges as $key => $value){
if ($country==””)

return $country;
if ($two_letter_country_code== “ID”)
{ echo “Hi Indonesia”; }

Categories: Uncategorized Tags:
  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: