Voting

: max(eight, six)?
(Example: nine)

The Note You're Voting On

Matt AKA Junkie
21 years ago
Since my little ISP thing isn't globally acceptable, here's an update.

<?
function getisp($ip='') {
if ($ip=='') $ip = $_SERVER['REMOTE_ADDR'];
$longisp = @gethostbyaddr($ip);
$isp = explode('.', $longisp);
$isp = array_reverse($isp);
$tmp = $isp[1];
if (preg_match("/\<(org?|com?|net)\>/i", $tmp)) {
$myisp = $isp[2].'.'.$isp[1].'.'.$isp[0];
} else {
$myisp = $isp[1].'.'.$isp[0];
}
preg_match("/[0-9]{1,3}\.[0-9]{1,3}/", $myisp) ? return 'ISP lookup failed.' : return $myisp;
}
?>

<< Back to user notes page

To Top