This article mainly introduces the PHP implementation window platform CHECKDNSRR function, PHP's own CHECKDNSRR function only in the Linux platform is effective, this article simulates a window can be used under the CHECKDNSRR function, the need for friends can refer to the
PHP's own CHECKDNSRR function is only available on the Linux platform. The use of the Windows platform is used to be unable to use the words to cause trouble with compatibility.
So write a CHECKDNSRR simulation function to use in the window platform environment.
?
| 1 2 3 4 5 6 7 8 9 10 11 12-13 |
if (!function_exists (' CHECKDNSRR ')) {function checkdnsrr ($host, $type) {if (!empty ($host) &&!empty ($type)) {@e Xec (' nslookup-type= '. Escapeshellarg ($type). ' ' . Escapeshellarg ($host), $output); foreach ($output as $k => $line) {if (eregi (' ^ '. $host, $line)) {return true;}}} return false; } } |