源码网商城,靠谱的源码在线交易网站 我的订单 购物车 帮助

源码网商城

php实现window平台的checkdnsrr函数

  • 时间:2021-11-27 15:39 编辑: 来源: 阅读:
  • 扫一扫,手机访问
摘要: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;
  }
}
  • 全部评论(0)
联系客服
客服电话:
400-000-3129
微信版

扫一扫进微信版
返回顶部