<?xml version="1.0" encoding="UTF-8" ?>
<rss version="2.0">
<channel>
<title><![CDATA[向东博客 专注WEB应用 构架之美 --- 构架之美，在于尽态极妍 | 应用之美，在于药到病除]]></title> 
<link>http://www.jackxiang.com/index.php</link> 
<description><![CDATA[赢在IT，Playin' with IT,Focus on Killer Application,Marketing Meets Technology.]]></description> 
<language>zh-cn</language> 
<copyright><![CDATA[向东博客 专注WEB应用 构架之美 --- 构架之美，在于尽态极妍 | 应用之美，在于药到病除]]></copyright>
<item>
<link>http://www.jackxiang.com/post//</link>
<title><![CDATA[把IP地址按整型存入数据库的转换的PHP程序 ]]></title> 
<author>jack &lt;xdy108@126.com&gt;</author>
<category><![CDATA[WEB2.0]]></category>
<pubDate>Thu, 29 Jul 2010 05:15:28 +0000</pubDate> 
<guid>http://www.jackxiang.com/post//</guid> 
<description>
<![CDATA[ 
	<br/><div class="code">&lt;?php<br/>//IP转换成整数的函数<br/><br/>function IptoInt($ip)<br/>&#123;<br/>&nbsp;&nbsp;&nbsp;&nbsp;$ipa=explode(&quot;.&quot;,$ip);<br/>&nbsp;&nbsp;&nbsp;&nbsp;$ipn=$ipa&#91;0&#93;*16777216+$ipa&#91;1&#93;*65536+$ipa&#91;2&#93;*256+$ipa&#91;3&#93;;<br/>&nbsp;&nbsp;&nbsp;&nbsp;return $ipn;<br/>&#125;<br/><br/>&nbsp;&nbsp; // 整数还原成IP的函数<br/><br/>&nbsp;&nbsp; function InttoIp($value)<br/>&nbsp;&nbsp; &#123;<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $bin = decbin($value);<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $zeros = 32 - strlen($value);<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; for($i=0;$i&lt;$zeros;$i++)<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $bin = &#039;0&#039;.$bin;<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $arr = str_split($bin,8);<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $ip=&#039;&#039;;<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; for($i=0;$i&lt;count($arr);$i++)&#123;<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $ip .= bindec($arr&#91;$i&#93;).&quot;.&quot;;<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &#125;<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $ip=substr($ip,0,strlen($ip)-1);<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return $ip;<br/>&nbsp;&nbsp;&nbsp;&nbsp;&#125;<br/><br/>?&gt;<br/><br/><br/>&lt;?php<br/>&nbsp;&nbsp; echo IptoInt(&quot;192.168.0.1&quot;);<br/>&nbsp;&nbsp; echo &quot;&#92;n&quot;;<br/>echo IptoInt(&quot;255.255.255.255&quot;);<br/>?&gt;</div><br/><br/><br/><div class="code">比如这个：255.255.255.255这个，掏出windows计数器，运行：输入calc<br/>对应二进制是32个1：11111111111111111111111111111111&nbsp;&nbsp;选择二进制输入32个1：<br/>然后转为十进制：也就是点十进制。<br/>结果为：4294967295</div><br/><br/>php计算的结果：<br/><div class="code">&#91;~&#93;# php ip.php<br/>3232235521<br/>4294967295</div><br/><br/>说明这个长整形就是这样转的，呵呵。
]]>
</description>
</item><item>
<link>http://www.jackxiang.com/post//#blogcomment</link>
<title><![CDATA[[评论] 把IP地址按整型存入数据库的转换的PHP程序 ]]></title> 
<author> &lt;user@domain.com&gt;</author>
<category><![CDATA[评论]]></category>
<pubDate>Thu, 01 Jan 1970 00:00:00 +0000</pubDate> 
<guid>http://www.jackxiang.com/post//#blogcomment</guid> 
<description>
<![CDATA[ 
	
]]>
</description>
</item>
</channel>
</rss>