php实现window平台的checkdnsrr函数
2015-05-27 10:50
417 查看
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实现window平台的checkdnsrr函数
- window平台使用bat批处理实现进程守护
- 基于Docker容器和PHP技术的简易多人在线编程平台(云IDE)的实现
- Redis安装整理(window平台) +php扩展redis
- Android中实现java与PHP服务器(基于新浪云免费云平台)http通信详
- 微信/易信公共平台开发(二):自定义菜单的PHP实现(提供源码)
- window平台下php连接Oracle
- 在windows平台上构建自己的PHP实现方法(仅适用于php5.2)
- 利用码云平台和wamp集成环境,实现多人开发php项目laravel框架构建的前凑准备
- 短信平台PHP代码实现
- window下如何实现定时执行php脚本
- WinRAR(WinZip)压缩与解压实现(C#版Window平台)
- Redis安装整理(window平台) +php扩展redis
- WinRAR(WinZip)压缩与解压实现(C#版Window平台)
- Redis安装整理(window平台) +php扩展redis
- Redis安装整理(window平台) +php扩展redis
- Linux平台中使用PHP把word转pdf的实现方法
- PHP平台的AFM-RPC实现----amfphp(二)HelloWorld范例
- suse linux enterprise server 10与window平台实现局域网访问