When a user fills out a form I want to see if what the user typed is the same as whats in my db. However, I don't want it to be case sensitive. If I use = when comparing, ex: if($subject==$temp_subject), will it be case sensitive? If yes how do I have the two variables compare and not matter on case.
I appreciate the help,
Ace
Not case sensitive
Moderator: General Moderators
- protokol
- Forum Contributor
- Posts: 353
- Joined: Fri Jun 21, 2002 7:00 pm
- Location: Cleveland, OH
- Contact:
you could check out strcasecmp()
OR
try this:
if (strtolower($subject) == strtolower($temp_subject)) {
}
OR
try this:
if (strtolower($subject) == strtolower($temp_subject)) {
}
or you could always do it on the SQL level:
i think upper() is Oracle-specific, but you get the idea....
Code: Select all
$sql="select foo from bar where upper(test)='".strtoupper($input)."'";