I wanted to be able to pass an IP address in a URL always as an unsigned int. I then converted it back as shown below:
$ip_addr = "192.168.100.25"; // example IP address that converts to neg #
$s32int = ip2long($ip_addr);
$us32str = sprintf("%u",$s32int); // convert to unsigned string
// display orig IP address, signed 32 bit version, unsigned 32 bit ver,
// finally converted back to IP addr
printf("%s ,%d, %s, %s", $ip_addr, $s32int, $us32str,
long2ip(-(4294967296-$us32str)));
// tested on Linux/Apache PHP 4.1.2