ip2long
(PHP4 >= 4.0RC1)
ip2long --- 轉換 IP(IPv4)成為適當的位址
語法 :
int ip2long(string ip_address)說明 :
ip2long( )從它的Internet標準格式(有逗點的字串),產生IPv4 Internet network位址。
Example :
<?php
$ip = gethostbyname("www.php.net");
$out = "The following URLs are equivalent:<br>\n";
$out .= "http://www.php.net/, http://".$ip."/, and http://".ip2long($ip)."/<br>\n";
echo $out;
?>
參考 : long2ip( )