<?php
class checkIPRange {
public $ip;
public $country; //ISO format only
private function LoadDB(){
$file = $this->$country."Range.xml";
if (!file_exists($file)){
echo $file." - File Base Not Found";
Exit();
}
$XmlString = file_get_contents($file);
$xml = simplexml_load_string($XmlString);
$json = json_encode($xml);
$array = json_decode($json,TRUE);
return $array;
}
private function IPtoINT($ip){
$IntIp = str_replace(".", "", $ip);
$IntIp = (int)$IntIp;
return $IntIp;
}
public function SearchIP(){
$IntIp = $this->IPtoINT($this->$ip);
$array = $this->LoadDB();
foreach ($array as $aString){
$RangesIP = trim($aString['RangeIP']);
$aRangesIP = explode(",",$RangesIP);
foreach ($aRangesIP as $RangeIP){
$aRangeIP = explode("-",$RangeIP);
$aRangeIP[0] = $this->IPtoINT($aRangeIP[0]);
$aRangeIP[1] = $this->IPtoINT($aRangeIP[1]);
if ($IntIp >= $aRangeIP[0] and $IntIp <= $aRangeIP[1]){
return true;
}
}
}
}
}
Не понимаю что за ошибка - помогите