0

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.

hakre
  • 193,403
  • 52
  • 435
  • 836

1 Answers1

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

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

mvds
  • 45,755
  • 8
  • 102
  • 111