PHP making input from web form case insensitive?
Posted
by Haskella
on Stack Overflow
See other posts from Stack Overflow
or by Haskella
Published on 2010-05-25T12:40:09Z
Indexed on
2010/05/25
12:51 UTC
Read the original article
Hit count: 267
So I have some code here that takes user input from a standard web form:
$searchsport = $_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.
© Stack Overflow or respective owner