php实现window平台的checkdnsrr函数
时间:2021-07-12 13:29:48|栏目:PHP代码|点击: 次
PHP的自带checkdnsrr函数只在linux平台有效。使用惯了在window平台不能使用的话给兼容性带来麻烦。
因此写了个checkdnsrr模拟函数在window平台环境使用。
if (!function_exists('checkdnsrr ')) {
function checkdnsrr($host, $type) {
if(!empty($host) && !empty($type)) {
@exec('nslookup -type=' . escapeshellarg($type) . ' ' . escapeshellarg($host), $output);
foreach ($output as $k => $line) {
if(eregi('^' . $host, $line)) {
return true;
}
}
}
return false;
}
}
上一篇:通过PHP的内置函数,通过DES算法对数据加密和解密
栏 目:PHP代码
下一篇:PHP 验证登陆类分享
本文标题:php实现window平台的checkdnsrr函数
本文地址:http://www.codeinn.net/misctech/156258.html






