I just wanted to ask if this is a secure way to let a user choose his username(user can use every digit):
if($_POST['username'] != "") {
$username = trim($_POST['username']);
$username = filter_var($username, FILTER_SANITIZE_STRING, FILTER_FLAG_STRIP_LOW);
}
After this snippet I use PDO (prepared statement) to insert data in database.
You think this is secure enough or did I forget some important points?