Skip to content

Simple PHP code snippet to get an IP info from several sources and options

Notifications You must be signed in to change notification settings

abdalrhman-alajlouni/PHP-GetIpInfo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 

Repository files navigation

PHP-GetIpInfo

Simple PHP code snippet to get an IP info from several sources and options

Usage

$ip = "8.8.8.8"; // An IP Address

$IpInfo = GetUserIPInfo($ip); // Call the function
$country = $IpInfo['country'] ?? "Unknown";
$city = $IpInfo['city'] ?? "Unknown";
$loc = $IpInfo['loc'] ?? "Unknown";
$org = $IpInfo['org'] ?? "Unknown";
$timezone = $IpInfo['timezone'] ?? "Unknown";

echo $country; // US
echo $city; // Los Angeles
echo $loc; // 34.0522342,-118.2436849
echo $org; // Google LLC
echo $timezone; // America/Los_Angeles

About

Simple PHP code snippet to get an IP info from several sources and options

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages