wafflestomper Posted April 14, 2007 Share Posted April 14, 2007 If I want each user to sign in with a unique username, how would I deal with the cases like "Mike" and "mike"? I don't want to separate usernames, both as mike. Is there a way to make all the entries entered into the database lowercase? Or some way to solve this issue? Link to comment https://forums.phpfreaks.com/topic/47040-solved-lowercase-usernames/ Share on other sites More sharing options...
paul2463 Posted April 14, 2007 Share Posted April 14, 2007 have a look here at <a href="http://uk3.php.net/strtolower"> strtolower() </a> Link to comment https://forums.phpfreaks.com/topic/47040-solved-lowercase-usernames/#findComment-229390 Share on other sites More sharing options...
yzerman Posted April 14, 2007 Share Posted April 14, 2007 <?php $str = "Mary Had A Little Lamb and She LOVED It So"; $str = strtolower($str); echo $str; // Prints mary had a little lamb and she loved it so ?> http://www.php.net/strtolower This function, as it states, will make all the letters in a string, lowercase. You can then check the database for the existing username - in lowercase form. Hope this helps. Link to comment https://forums.phpfreaks.com/topic/47040-solved-lowercase-usernames/#findComment-229392 Share on other sites More sharing options...
wafflestomper Posted April 14, 2007 Author Share Posted April 14, 2007 Beautiful, thanks to both of you. Link to comment https://forums.phpfreaks.com/topic/47040-solved-lowercase-usernames/#findComment-229395 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.