I'm trying to check if ip6 is not connected in my code using php. My idea now is to calculate the loading if it is going to connect. I try to use this code.
$file = file_get_contents('http://ip6.me/');
// Trim IP based on HTML formatting
$pos = strpos( $file, '+3' ) + 3;
$ip = substr( $file, $pos, strlen( $file ) );
// Trim IP based on HTML formatting
$pos = strpos( $ip, '</' );
$ip = substr( $ip, 0, $pos );
$ipaddress = $ip;
$ip_get = explode('.',$ipaddress);
this work fine with me if will get ip address. But there is a time that ip6 down and it load to much. What is the best way to check if ip6 is down? I try to calculate the load of browser, but I have no idea how to do it.