Hello everyone
i have a slight problem with my preg_replace function;
i am using the following function to sanitize an 'imput field ' on a form.
$firstname = preg_replace('#[^A-Za-z0-9]#i', '', $firstname);
I am trying to prevent users from imputing character symbols like '@' in the field.
The function works, it however eliminate all 'white space'. thus, if a user has two name, the function joins the two names togehter.
how can i recode the function so that it keep the space between the two names.
Thanks for your help everyone.
warm regards
Andreea