Hello and thanks a head of time ;-)

I'm wondering about ip2long

If highest ip possible is

ip2long( '255.255.255.255 ) = 4294967295

and lowest possible is
ip2long( '1.0.0.0' ) = 16777216

  1. What do some ip's give negative integers?

  2. how can I find out what lowest possible negative integer is? I figured that 1.0.0.0 would be the lowest but if it generates a - number then what the hay... lol

    As stated on the [man]ip2long[/man] page:

    Note: Because PHP's integer type is signed, and many IP addresses will result in negative integers, you need to use the "%u" formatter of [man]sprintf/man or [man]printf/man to get the string representation of the unsigned IP address.

      Write a Reply...