$ipv6 = '2a01:4f8:190:4413::2';
$ipv4 = hexdec(substr($ipv6, 0, 2)). "." . hexdec(substr($ipv6, 2, 2)). "." . hexdec(substr($ipv6, 5, 2)). "." . hexdec(substr($ipv6, 7, 2));
echo $ipv4;
$ipv6 = '2a01:4f8:190:4413::2';
$ipv4 = hexdec(substr($ipv6, 0, 2)). "." . hexdec(substr($ipv6, 2, 2)). "." . hexdec(substr($ipv6, 5, 2)). "." . hexdec(substr($ipv6, 7, 2));
echo $ipv4;
本文标题:php代码将ipv6地址转为ipv4地址
本文链接:https://www.haomeiwen.com/subject/ekzsnctx.html
网友评论