diff options
Diffstat (limited to 'ifconfig/ifconfig.php')
| -rw-r--r-- | ifconfig/ifconfig.php | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/ifconfig/ifconfig.php b/ifconfig/ifconfig.php index cf1dc8f..33ec5ba 100644 --- a/ifconfig/ifconfig.php +++ b/ifconfig/ifconfig.php @@ -19,9 +19,15 @@ class Ifconfig { } public function getAllGeoipRecords(){ + $tmp = geoip_record_by_name( $this->ip ); - unset($tmp['dma_code']); - unset($tmp['area_code']); + if( $tmp ){ + unset($tmp['dma_code']); + unset($tmp['area_code']); + } else { + $tmp = array ( "status" => "Data not available"); + } + return $tmp; } |
