I have an old script that I am reusing in a new one.
But I think I read somewhere that eregi is something one should not use anymore.
What should I replace my line with then?
I have a form where people register. My script is supposed to check that the fields are correct.
That they actually write their name, e-mail and so on.
The one I have now is:
if($user_name != "" && eregi('[a-z | A-Z]+',$user_name)){
$debug=TRUE;
} else {
$debug=FALSE;
$message[]="<span class='error'>You need to fill in a correct name</span><br />";
}
That one is looking for letters in the field.
What should I replace this code with in my script?
And… this time I want the code to work in other languages too. I need people to be able to use swedish charcters (å ä ö, Å Ä Ö) and german (like ü or Ü or whatever). I guess my code is only accepting a-z and A-Z.
Is there a way to make my code work in a better way?