Re: [PHP] IPv6 validation
- From: kevin@xxxxxxxxx (Kevin Waterson)
- Date: Sat, 12 Jul 2008 23:04:39 +1000
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";
}
?>
.
- Follow-Ups:
- Re: [PHP] IPv6 validation
- From: "Bernhard Kohl"
- Re: [PHP] IPv6 validation
- References:
- [PHP] IPv6 validation
- From: Yeti
- [PHP] IPv6 validation
- Prev by Date: [PHP] IPv6 validation
- Next by Date: Re: chmod 777 - isn't this a security risk? Needed for PEAR CAPTCHA
- Previous by thread: [PHP] IPv6 validation
- Next by thread: Re: [PHP] IPv6 validation
- Index(es):
Relevant Pages
|