Re: [PHP] IPv6 validation
- From: "TWayne" <nobody@xxxxxxxxxxxxxxxxxxx>
- Date: Mon, 14 Jul 2008 20:31:37 -0400
Doesnt filter_var() require PHP5+ ?
Yes. In fact, 5.2.3 or above, if I'm not mistaken. I know it's fine in
5.2.5. Check your servers; several are "stuck" at 5.2.2 for some reason
I don't understand and it won't work right.
HTH
I have quite some systems still running 4.4.8.
On 7/12/08, Kevin Waterson <kevin@xxxxxxxxx> wrote:
This one time, at band camp, Yeti <yeti@xxxxxxxxxx> wrote:
Now i was wondering of what there might be the best way to validate
an IPv6 address.
from this url..
http://phpro.org/tutorials/Filtering-Data-with-PHP.html#9
<?php
/*** an IP address ***/
$ip = "2001:0db8:85a3:08d3:1319:8a2e:0370:7334";
/*** try to validate as IPV6 address ***/
if(filter_var($ip, FILTER_VALIDATE_IP, FILTER_FLAG_IPV6) === FALSE)
{
echo "$ip is not a valid IP";
}
else
{
echo "$ip is valid";
}
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
.
- References:
- [PHP] IPv6 validation
- From: Yeti
- Re: [PHP] IPv6 validation
- From: Kevin Waterson
- Re: [PHP] IPv6 validation
- From: "Bernhard Kohl"
- [PHP] IPv6 validation
- Prev by Date: Re: [PHP] Should I go with the Singleton Pattern or wait for 5.3?
- Next by Date: RE: [PHP] mkdir permission errors
- Previous by thread: Re: [PHP] IPv6 validation
- Next by thread: Passing arguments as they are received to another function
- Index(es):
Relevant Pages
|