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

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

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

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

因此寫了個(gè)checkdnsrr模擬函數(shù)在window平臺(tái)環(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;
  }
}

相關(guān)文章

最新評(píng)論