note 34524 deleted from function.gethostbyaddr by irchtml
| From: | irchtml@php.net | Date: | Sun, 29 Feb 2004 21:28:53 +0000 |
| Subject: | note 34524 deleted from function.gethostbyaddr by irchtml | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-66006@lists.php.net to get a copy of this message | ||
Note Submitter: Matt AKA junkie
----
Well, here's my function I never bothered to make, referenced by the note below.
<?
function getisp ($ip) {
if ($ip==NULL) {
$ip = $_SERVER['REMOTE_ADDR'];
}
$longisp = gethostbyaddr($ip);
$isp = explode(".", $longisp);
$isp = array_reverse($isp);
$ISP = $isp[1].".".$isp[0];
return $ISP;
}
?>
At first I didn't think explode was working with my previous thing, but that was because I was
using arsort() instead of array_reverse().
All is good now. ^.^