Whenever I try to use the ip2long() function, I get back a negative number. Whenever I use bindec() to convert a binary number to decimal, I get back a negative number as well. Is there someting wrong with my config, or am I not using these functions correctly?
Taken straight from the manual (http://php.net/manual/function.ip2long.php):
<?php
$ip = gethostbyname("www.php.net");
$out = "The following URLs are equivalent:<br>\n";
$out .= "http://www.php.net/, http://".$ip."/, and http://".ip2long($ip)."/<br>\n";
echo $out;
?>
The result for me is this: http://nemesis2.com/testdir/ip2long.php
I am using php-4.0.3pl1. Can anyone else verify that this function works or does not work for them?
Thanks,
Jason