However, i would like the user to only be able to enter in this field, the letters A-Z, a-z and 0-9, with no other chars allowed.Any other chars should be just stripped out.
I currently do this... but its a poor way to do it...
Code: Select all
$keyword = str_replace ( '?', '', $keyword );
$keyword = str_replace ( '&', '', $keyword );
$keyword = str_replace ( '!', '', $keyword );an example string "hello!"$%%^^*" would just be "hello"