So I have some code here that takes user input from a standard web form:
if (get_magic_quotes_gpc()) {
$searchsport = stripslashes($_POST['sport']);
$sportarray = array(
"Football" => "Fb01",
"Cricket" => "ck32",
"Tennis" => "Tn43",
);
if(isset($sportarray[$searchsport])){
header("Location: ".$sportarray[$searchsport].".html");
die;
}
How would I go about modifying this (I think the word is parsing?) to make it case *in*sensitive? For example, I type in "fOoTbAlL" and php will direct me to Fb01.html normally.
EDIT: Note that the code is just an example, the string entered by the user can contain more than one word say "Crazy aWesOme HarpOOn-Fishing" and it would still work if the array element "Crazy Awesome Harpoon-Fishing" (take note of the capital F before the dash).