I am facing the following problem:
_ I have a file in my server checking the ip's from the visitors working perfectly but I am figuring an error in following code:
$pagesource = file_get_contents('http://myserver/ip.php');
echo $pagesource; //correctly displayed ip: xxx.xxx.xxx.xxx
$ip = explode(":",str_replace(' ', '', $pagesource));
echo $ip[1]; //correctly displayed xxx.xxx.xxx.xxx
echo ip2long($ip[1]); //ERROR! nothing displayed...
I have php 5.2.3 and if I use
$ip[1]="127.0.0.1";
echo ip2long($ip[1]);
It works FINE
What is my problem?