I want to run a check on something added in a form.... i want it to not worry about upper and lower case... so FIRST and first and First are all the same.. how can i do this?
You can lcase or ucase both variable
if (lcase($var1) == lcase($var2)) { //Are Same } else { //Are different }
and for uppercase only, use strtoupper
You can also use strcasecmp().
I'm guessing that performance-wise, it might be faster (although probably not by too much), since you don't need to call lcase every time. Who knows, it might just do the exact same thing behind the scenes...
Mhhh I can't edit my post, but I ment a strtolower (lcase is ASP if I am correct)
Terminator;10882174 wrote:You can lcase or ucase both variable if (lcase($var1) == lcase($var2)) { //Are Same } else { //Are different } and for uppercase only, use strtoupper