Manuel Pear

Net_GeoIP::lookupOrg()

Net_GeoIP::lookupOrg() --  returns the name of the organization or ISP for the given IP address.

Synopsis

  1. <?php
  2. require_once "Net/GeoIP.php
  3. ?> 

string lookupOrg() (string $addr)

Description

This method returns the name of the organization or of the ISP which has registered the IP address range that contains the specified IP address. It works only with a non-free Organization/ISP database.

Exemple 54-1. Looking up organization name

  1. <?php
  2. require_once "Net/GeoIP.php";  
  3.  
  4. $geoip = Net_GeoIP::getInstance("/path/to/geoipdb.dat");  
  5.  
  6. try { 
  7.    echo $geoip->lookupOrg($_SERVER['REMOTE_ADDR']);  
  8. } catch (Exception $e) { 
  9.    // Handle exception
  10. ?> 

Paramètres

  • string $addr - IP address

    Note : Hostnames are not supported. More information.

Valeurs renvoyées

This method throws an exception if the IP address is invalid or the database type is wrong.


Remonter Remonter
L'éditeur javascript - CSS - Gentoo - Tutoriaux PHP - Tutoriels PHP - Bretagne - php - Moto - Kit graphique