Code: Select all
function validate_input($input, $allowspaces = 0)
{
$check = ($allowspaces==0)?"^([a-zA-Z0-9\-\._])*$":"^([a-zA-Z0-9\-\._ ])*$";
if (!eregi($check, $input))
{
return 0;
}
else return 1;
}How can I add another option to allow the following characters: . / ! ? $ * - [ ] ( ) ' " ; : ,
But still be safe?
Thanks if you can help me