2013-03-26 19 views
-1
function processAvailable($used_limit) 
{ 
    // determine matching type 
    if (strpos($this->CORE->CONFIG->NAMESERVERS[$this->server][($used_limit ? "limit_keyword" : "keyword")], "!!!") === 0) 
    { 
     $opposite = true; 
     $keyword = substr($this->CORE->CONFIG->NAMESERVERS[$this->server][($used_limit ? "limit_keyword" : "keyword")], 3); 
    } 
    else 
    { 
     $opposite = false; 
     $keyword = $this->CORE->CONFIG->NAMESERVERS[$this->server][($used_limit ? "limit_keyword" : "keyword")]; 
    } 


    // determine if available 
    if (preg_match($keyword, $this->whoisData)) 
     $this->available = !$opposite; 
    else 
     $this->available = $opposite; 
} 

線336是其中preg_match是和當我把分隔符頂部爲limit_keyword參數爲/limit_keyword/我收到以下錯誤;警告:的preg_match():定界符不能在C字母數字或反斜槓: XAMPP htdocs中的whois 類上線engine.php 336

C:\xampp\htdocs\whois\classes\engine.php on line 336

幫助請

回答

2

$keyword值不是一個有效的正則表達式空的正則表達式。另外,我認爲這種情況無論如何都是過度的。你可能應該使用stristr()

if (stristr($this->whoisData, $keyword)) // <-- notice the reversed needle and haystack 
+1

你搖滾的人,謝謝你的幫助,它完美的作品 – 2013-03-26 13:24:49

相關問題