= 7) { $username = substr($username, 0, 6); $current = 6; } for ($i = 0; $i < (9 - $current); $i++) { $username .= rand(0,9); } return $username; }