Jump to content

[SOLVED] lowercase usernames


wafflestomper

Recommended Posts

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

<?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.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.