PHP - geoip_asnum_by_name()
The geoip_asnum_by_name() function can get the Autonomous System Numbers (ASN).
Syntax
string geoip_asnum_by_name ( string $hostname )
The geoip_asnum_by_name() function can return the Autonomous System Numbers (ASN) associated with an IP address.
The geoip_asnum_by_name() function can return the ASN on success, or false if the address can't be found in the database.
Example
<?php
$hostname = "www.tutorialspoint.com";
// Get the ASN from $hostname
$asn = geoip_asnum_by_name($hostname);
if($asn) {
echo "ASN: {$asn}";
}
?>
php_function_reference.htm
Advertisements