/ Published in: PHP
Takes a full string of a username - "Jack Bourne" and returns "jackbourne"
Parameters are $original (full name) and $passno (identification number etc)
Parameters are $original (full name) and $passno (identification number etc)
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
function convert_to_username($original, $passno) { //check if this username already exist (this is using my library, you have to change this with whatever mysql query u need. this is to check whether the name exists) $check = $sql->selectSQL("COUNT(*) as how_many","admin_login","WHERE uname LIKE '$uname'"); //if already exist, append passno into the username to avoid duplicate username if ($check > 0) { $uname .= $passno_strip; } return $uname;}