欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

php實現(xiàn)window平臺的checkdnsrr函數(shù)

 更新時間:2015年05月27日 10:50:39   投稿:junjie  
這篇文章主要介紹了php實現(xiàn)window平臺的checkdnsrr函數(shù),PHP的自帶checkdnsrr函數(shù)只在linux平臺有效,本文就模擬出了一個window下可以使用的checkdnsrr函數(shù),需要的朋友可以參考下

PHP的自帶checkdnsrr函數(shù)只在linux平臺有效。使用慣了在window平臺不能使用的話給兼容性帶來麻煩。

因此寫了個checkdnsrr模擬函數(shù)在window平臺環(huán)境使用。

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

相關文章

最新評論