I am working on a quiz program. I need to be able to search for sting ignoring case. The answer on the system may be "Shielded Cable" but I would like "shielded cable", "Shielded CABLE" and even "ShieldeD cable" to be acceptable also.
I currently use:
$q_an[$i]=array_search($answer[$i],$q_answer_decoded);
where $answer[$i] is the answer that the user typed in
$q_answer_decoded is an array of the possible correct answers
$q_an[$i] becomes the position of the answer within the array (or null if the answer is not correct)
but this will only work if both are identical in both case and content.
Any ideas?
Thank you.
Brian