/ Published in: PHP
/********************************************************************************/
/* Description: Calculate and Convert IPV6 to Decimal. */
/* For information, please visit http://www.ip2location.com */
/********************************************************************************/
/* You can obtain free IPV6 database at http://www.ip2location.com/free/ipv6 */
/* Description: Calculate and Convert IPV6 to Decimal. */
/* For information, please visit http://www.ip2location.com */
/********************************************************************************/
/* You can obtain free IPV6 database at http://www.ip2location.com/free/ipv6 */
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
<?php function ip62long($ipv6){ $ip_n = inet_pton($ipv6); $bits = 15; $ipv6long = 0; while($bits >= 0){ if($ipv6long){ $ipv6long = $bin . $ipv6long; } else{ $ipv6long = $bin; } $bits--; } } ?>
URL: http://www.ip2location.com/free/ipv6