I've got a string in a database, "abcde" I want to be able to run a function that checks if "ABcdE" is in the database without worrying about case. How would I go about making PHP recognize them as equivalent?
Thanx, Chad
$stringa = "abcde"; $stringb = "ABCDE"; if(strtolower($stringa) == strtolower($stringb)){ echo "They are the same"; } else { echo "They are not the same"; }
hope this helps
adam
You could also cast them in the SQL query.
SELECT lower(blah) FROM table WHERE string = 'abcde' SELECT upper(blah) FROM table WHERE string = 'ABCDE'
Perfect! Thanx weekender and LordShryku.
-Chad