<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Lostdomain.org &#187; php</title>
	<atom:link href="http://lostdomain.org/tag/php/feed/" rel="self" type="application/rss+xml" />
	<link>http://lostdomain.org</link>
	<description>To find yourself, think for yourself.</description>
	<lastBuildDate>Sat, 06 Mar 2010 02:24:49 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>PHP4 IPv6 validation</title>
		<link>http://lostdomain.org/2009/05/04/php4-ipv6-validation/</link>
		<comments>http://lostdomain.org/2009/05/04/php4-ipv6-validation/#comments</comments>
		<pubDate>Mon, 04 May 2009 12:17:11 +0000</pubDate>
		<dc:creator>Martijn</dc:creator>
				<category><![CDATA[ipv6]]></category>
		<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://lostdomain.org/?p=80</guid>
		<description><![CDATA[Incase you don&#8217;t have the luxury of PHP5&#8217;s filter_ functions, this is a handy regexp:
function validate_ipv6($ip)
{
	$hex		= &#8216;[A-Fa-f0-9]&#8216;;
	$h16		= &#8220;{$hex}{1,4}&#8221;;
	$dec_octet	= &#8216;(?:25[0-5]&#124;2[0-4]d&#124;1dd&#124;[1-9]d&#124;[0-9])&#8217;;
	$ipv4		= &#8220;$dec_octet\.$dec_octet\.$dec_octet\.$dec_octet&#8221;;
	$ls32		= &#8220;(?:$h16:$h16&#124;$ipv4)&#8221;;
	$ipv6		= &#8220;(?:(?:{$IPv4address})&#124;(?:&#8221;.
				&#8220;(?:$h16:){6}$ls32&#8243; .
				&#8220;&#124;::(?:$h16:){5}$ls32&#8243; .
				&#8220;&#124;(?:$h16)?::(?:$h16:){4}$ls32&#8243; .
				&#8220;&#124;(?:(?:$h16:){0,1}$h16)?::(?:$h16:){3}$ls32&#8243; .
				&#8220;&#124;(?:(?:$h16:){0,2}$h16)?::(?:$h16:){2}$ls32&#8243; .
				&#8220;&#124;(?:(?:$h16:){0,3}$h16)?::(?:$h16:){1}$ls32&#8243; .
				&#8220;&#124;(?:(?:$h16:){0,4}$h16)?::$ls32&#8243; .
				&#8220;&#124;(?:(?:$h16:){0,5}$h16)?::$h16&#8243; .
				&#8220;&#124;(?:(?:$h16:){0,6}$h16)?::&#8221; .
				&#8220;)(?:\/(?:12[0-8]&#124;1[0-1][0-9]&#124;[1-9][0-9]&#124;[0-9]))?)&#8221;;
	$regex = &#8220;/^$ipv6$/&#8221;;
	return preg_match($regex, $ip);
}
]]></description>
			<content:encoded><![CDATA[<p>Incase you don&#8217;t have the luxury of PHP5&#8217;s filter_ functions, this is a handy regexp:</p>
<blockquote><p>function validate_ipv6($ip)<br />
{<br />
	$hex		= &#8216;[A-Fa-f0-9]&#8216;;<br />
	$h16		= &#8220;{$hex}{1,4}&#8221;;<br />
	$dec_octet	= &#8216;(?:25[0-5]|2[0-4]d|1dd|[1-9]d|[0-9])&#8217;;<br />
	$ipv4		= &#8220;$dec_octet\.$dec_octet\.$dec_octet\.$dec_octet&#8221;;<br />
	$ls32		= &#8220;(?:$h16:$h16|$ipv4)&#8221;;<br />
	$ipv6		= &#8220;(?:(?:{$IPv4address})|(?:&#8221;.<br />
				&#8220;(?:$h16:){6}$ls32&#8243; .<br />
				&#8220;|::(?:$h16:){5}$ls32&#8243; .<br />
				&#8220;|(?:$h16)?::(?:$h16:){4}$ls32&#8243; .<br />
				&#8220;|(?:(?:$h16:){0,1}$h16)?::(?:$h16:){3}$ls32&#8243; .<br />
				&#8220;|(?:(?:$h16:){0,2}$h16)?::(?:$h16:){2}$ls32&#8243; .<br />
				&#8220;|(?:(?:$h16:){0,3}$h16)?::(?:$h16:){1}$ls32&#8243; .<br />
				&#8220;|(?:(?:$h16:){0,4}$h16)?::$ls32&#8243; .<br />
				&#8220;|(?:(?:$h16:){0,5}$h16)?::$h16&#8243; .<br />
				&#8220;|(?:(?:$h16:){0,6}$h16)?::&#8221; .<br />
				&#8220;)(?:\/(?:12[0-8]|1[0-1][0-9]|[1-9][0-9]|[0-9]))?)&#8221;;</p>
<p>	$regex = &#8220;/^$ipv6$/&#8221;;<br />
	return preg_match($regex, $ip);<br />
}</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://lostdomain.org/2009/05/04/php4-ipv6-validation/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
