Welcome 微信登录
编程资源 图片资源库 蚂蚁家优选 PDF转换器 软件资源

软件开发小程序制作系统集成与运维空间租用硬件开发视频监控技术咨询与支持——联系电话:0311-88999002/88999003

首页 / 网页编程 / PHP / php实现window平台的checkdnsrr函数

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;}}