note 25226 modified in function.gethostbyaddr by nicos
| From: | nicos@php.net | Date: | Sun, 15 Sep 2002 15:29:56 +0000 |
| Subject: | note 25226 modified in function.gethostbyaddr by nicos | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-36702@lists.php.net to get a copy of this message | ||
This function seems to be very slow on IIS 4.0 Server (Win32). I use system call to NSLOOKUP instead
to get PC-Hostname:
unset ($execoutput);
exec ("nslookup $IPAdresse 2>nul",$execoutput,$nslookstatus);
if (isset ($execoutput[3]) && ereg ("^Name:
*([A-Za-z0-9]{2,})\.",$execoutput[3],$regs))
$nslookname=strtoupper($regs[1]);
else $nslookname="Unknown";
Note by members: This is not portable to Windows platforms. so you would be better to stay with our
function.
--was--
This function seems to be very slow on IIS 4.0 Server (Win32). I use system call to NSLOOKUP instead
to get PC-Hostname:
unset ($execoutput);
exec ("nslookup $IPAdresse 2>nul",$execoutput,$nslookstatus);
if (isset ($execoutput[3]) && ereg ("^Name:
*([A-Za-z0-9]{2,})\.",$execoutput[3],$regs))
$nslookname=strtoupper($regs[1]);
else $nslookname="Unknown";
http://www.php.net/manual/en/function.gethostbyaddr.php