You dont have to get that complicated with using POSIX... u can just use the ereg or eregi (case insensitive) function, ie:
$question = "what is California\'s Capital?";
$user_text = "Sacramento, CA";
$correct_answer = "Sacramento";
if( ! empty( $user_text )){ //Here, Im checking if the user has inputed text
if( eregi( "sacramento", $user_text)){
$msg = "Correct!";
}
else
{
$msg = "Incorrect! Try Again!";
}
}
hope that this helps!
brad Taylor
Senior Web Producer
BradCom Industries LTD
brad_at_getcoded.net (replace the at with @}