maxmind / GeoIP2-php

PHP API for GeoIP2 webservice client and database reader
https://maxmind.github.io/GeoIP2-php/
Apache License 2.0
2.33k stars 276 forks source link

Check if IP within database #17

Closed BassemN closed 10 years ago

BassemN commented 10 years ago

Hello,

Is there any function to check if the IP is existing in the database or not?

Thanks

oschwald commented 10 years ago

Hi,

The recommended way to do this is to just look up the IP in the database in a try block and catch GeoIp2\Exception\AddressNotFoundException.

shahroq commented 8 years ago

Hi, Can you provide a sample code for "The address ..... is not in the database" & "The value \"$ipAddress\" is not a valid IP address." ?