As Ron Maupin described, the solution is very simple
$ipv6 = "8ab8:7f70::";
$ipv4 = hexdec(substr($ipv6, 0, 2)). "." . hexdec(substr($ipv6, 2, 2)). "." . hexdec(substr($ipv6, 5, 2)). "." . hexdec(substr($ipv6, 7, 2));
3
solved Convert IPv6 to IPV4 PHP [closed]