2010-07-16 23 views
0

一些可以幫我重寫這些代碼:問題的額日格棄用

if (eregi($asked,$accepted)) { 
$this->plot_type = $which_pt; 
return true; 
} else { 
$this->DrawError('$which_pt not an acceptable plot type'); 
return false; 
} 

任何幫助將不勝感激,我已經試過我通過谷歌獲得了所有修復,但沒有一個能解決這個問題。

謝謝。

回答

0
if (preg_match($asked."i",$accepted)) // there is no case insensitive version of preg_match 
{ 
    $this->plot_type = $which_pt; 
    return true; 
} else { 
    $this->DrawError("$which_pt not an acceptable plot type"); // i think you want " instead of ' here 
    return false; 
} 

應該這樣做。如果沒有,請與我們分享$asked中正則表達式的內容。