<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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/"
		>
<channel>
	<title>Comments on: Convert an IP address to IP number with PHP, ASP, C# and VB.Net</title>
	<atom:link href="http://www.justin-cook.com/wp/2006/11/28/convert-an-ip-address-to-ip-number-with-php-asp-c-and-vbnet/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.justin-cook.com/wp/2006/11/28/convert-an-ip-address-to-ip-number-with-php-asp-c-and-vbnet/</link>
	<description>A web, technology, programming and SEO blog by Justin Cook</description>
	<lastBuildDate>Wed, 10 Mar 2010 21:22:18 -0600</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.6</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Jack</title>
		<link>http://www.justin-cook.com/wp/2006/11/28/convert-an-ip-address-to-ip-number-with-php-asp-c-and-vbnet/comment-page-1/#comment-155780</link>
		<dc:creator>Jack</dc:creator>
		<pubDate>Tue, 11 Aug 2009 14:51:26 +0000</pubDate>
		<guid isPermaLink="false">http://www.justin-cook.com/wp/2006/11/28/convert-an-ip-address-to-ip-number-with-php-asp-c-and-vbnet/#comment-155780</guid>
		<description>See similar converter in action at &lt;a href=&quot;http://www.webtoolhub.com/tn561377-ip-address-number-converter.aspx&quot; rel=&quot;nofollow&quot;&gt;http://www.webtoolhub.com/tn561377-ip-address-number-converter.aspx&lt;/a&gt;</description>
		<content:encoded><![CDATA[<p>See similar converter in action at <a href="http://www.webtoolhub.com/tn561377-ip-address-number-converter.aspx" rel="nofollow">http://www.webtoolhub.com/tn561377-ip-address-number-converter.aspx</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Josh</title>
		<link>http://www.justin-cook.com/wp/2006/11/28/convert-an-ip-address-to-ip-number-with-php-asp-c-and-vbnet/comment-page-1/#comment-155732</link>
		<dc:creator>Josh</dc:creator>
		<pubDate>Tue, 04 Aug 2009 12:58:11 +0000</pubDate>
		<guid isPermaLink="false">http://www.justin-cook.com/wp/2006/11/28/convert-an-ip-address-to-ip-number-with-php-asp-c-and-vbnet/#comment-155732</guid>
		<description>SQL/MySQL Anyone?

DELIMITER $$

DROP FUNCTION IF EXISTS `__schema__`.`INT2IP` $$
CREATE FUNCTION `__schema__`.`INT2IP` ( address INT UNSIGNED ) RETURNS VARCHAR(15)
BEGIN

RETURN CONCAT_WS(&#039;.&#039;,
  address &gt;&gt; 24 &amp; 255,
  address &gt;&gt; 16 &amp; 255,
  address &gt;&gt; 8 &amp; 255,
  address &amp; 255 );

END $$

DROP FUNCTION IF EXISTS `__schema__`.`IP2INT` $$
CREATE FUNCTION `__schema__`.`IP2INT` ( address VARCHAR(15) ) RETURNS INT UNSIGNED
BEGIN

RETURN
  SUBSTRING_INDEX( address, &#039;.&#039;, 1 ) * 16777216 +
  SUBSTRING_INDEX( SUBSTRING_INDEX( address, &#039;.&#039;, 2 ),&#039;.&#039;,-1 ) * 65536 +
  SUBSTRING_INDEX( SUBSTRING_INDEX( address, &#039;.&#039;, -2 ),&#039;.&#039;,1 ) * 256 +
  SUBSTRING_INDEX( address, &#039;.&#039;, -1 );

END $$

DELIMITER ;</description>
		<content:encoded><![CDATA[<p>SQL/MySQL Anyone?</p>
<p>DELIMITER $$</p>
<p>DROP FUNCTION IF EXISTS `__schema__`.`INT2IP` $$<br />
CREATE FUNCTION `__schema__`.`INT2IP` ( address INT UNSIGNED ) RETURNS VARCHAR(15)<br />
BEGIN</p>
<p>RETURN CONCAT_WS(&#039;.',<br />
  address &gt;&gt; 24 &amp; 255,<br />
  address &gt;&gt; 16 &amp; 255,<br />
  address &gt;&gt; 8 &amp; 255,<br />
  address &amp; 255 );</p>
<p>END $$</p>
<p>DROP FUNCTION IF EXISTS `__schema__`.`IP2INT` $$<br />
CREATE FUNCTION `__schema__`.`IP2INT` ( address VARCHAR(15) ) RETURNS INT UNSIGNED<br />
BEGIN</p>
<p>RETURN<br />
  SUBSTRING_INDEX( address, &#039;.&#039;, 1 ) * 16777216 +<br />
  SUBSTRING_INDEX( SUBSTRING_INDEX( address, &#039;.&#039;, 2 ),&#039;.',-1 ) * 65536 +<br />
  SUBSTRING_INDEX( SUBSTRING_INDEX( address, &#039;.&#039;, -2 ),&#039;.',1 ) * 256 +<br />
  SUBSTRING_INDEX( address, &#039;.&#039;, -1 );</p>
<p>END $$</p>
<p>DELIMITER ;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: pim</title>
		<link>http://www.justin-cook.com/wp/2006/11/28/convert-an-ip-address-to-ip-number-with-php-asp-c-and-vbnet/comment-page-1/#comment-154601</link>
		<dc:creator>pim</dc:creator>
		<pubDate>Fri, 13 Feb 2009 13:09:23 +0000</pubDate>
		<guid isPermaLink="false">http://www.justin-cook.com/wp/2006/11/28/convert-an-ip-address-to-ip-number-with-php-asp-c-and-vbnet/#comment-154601</guid>
		<description>Those 256 * 256 * 256 always make me laugh. Here&#039;s a PHP version that&#039;s roughly 2 times faster than the one in the post. And yes, I&#039;m aware of ip2long.

function ip2num( $ip )
{
   if ( empty( $ip ) ) return 0;
   $ip = explode( &#039;.&#039;, $ip );

   return ( $ip[0] &lt;&lt; 24 ) &#124; ( $ip[1] &lt;&lt; 16 ) &#124; ( $ip[2] &lt;&lt; 8 ) &#124; $ip[3];
}</description>
		<content:encoded><![CDATA[<p>Those 256 * 256 * 256 always make me laugh. Here&#039;s a PHP version that&#039;s roughly 2 times faster than the one in the post. And yes, I&#039;m aware of ip2long.</p>
<p>function ip2num( $ip )<br />
{<br />
   if ( empty( $ip ) ) return 0;<br />
   $ip = explode( &#039;.&#039;, $ip );</p>
<p>   return ( $ip[0] &lt;&lt; 24 ) | ( $ip[1] &lt;&lt; 16 ) | ( $ip[2] &lt;&lt; 8 ) | $ip[3];<br />
}</p>
]]></content:encoded>
	</item>
</channel>
</rss>

<!-- Dynamic Page Served (once) in 0.339 seconds -->
