views:

17

answers:

1

Can some please help me to rewrite these code:

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

Any help will be highly appreciated, I have tried all the fix I got through Google but none has been able to fix it.

Thanks.

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

should do it. If it doesn't, please share with us the content of the regular expression in $asked.

mvds