PHP | geoip_asnum_by_name() Function
Last Updated :
03 Jul, 2018
The geoip_asnum_by_name() is an inbuilt function in PHP which helps us to get the Autonomous System Number (ASN). The function will help us to get the ASN by taking an IP address as an argument .
Syntax :
string geoip_asnum_by_name ( string $hostname )
Return Values : It returns the ASN(Autonomous Syntax Number) on success and FALSE on failure.
Below program illustrate the geoip_asnum_by_name() function.
Program :
<?php
$asn = geoip_asnum_by_name( 'www.example.com' );
if ( $asn ) {
echo 'The ASN is:' . $asn ;
}
?>
|
Output:
The ASN is: AS15133 EdgeCast Networks, Inc
Reference : http://php.net/manual/en/function.geoip-asnum-by-name.php
Like Article
Suggest improvement
Share your thoughts in the comments
Please Login to comment...