On 20-09-2012 18:03, Jim Lucas wrote:
On 09/20/2012 02:35 AM, Sebastian Krebs wrote:
Plaseplease update... 5.1.6 is from 2006! I read the "it's required",
but I can't imagine _anything_ that it's worth it to use such an
extremely outdated, unsupported and therefore insecure and inefficient
version... You know: There are 3 (!) new minor versions available right
now (5.2, 5.3 and 5.4).

However: Regarding your concrete problem I guess you can use ip2long()

if (ip2long($ip)) {

I would suggest a modification to this.

if ( ip2long($ip) !== false ) {

I would actually suggest using inet_pton() instead of ip2long, since it can also handle IPv6 adresses, not only v4 which people here seem to think are the only ones in use on this planet. And I agree with Jim that you really should use a strict equality check in this case.

- Tul

PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to