This is a discussion on Regular expression and special characters within the alt.comp.lang.php forums, part of the PHP Programming Forums category; Hi! I need to validate a text field in a form (you can enter only text and no spaces). But ...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
Hi!
I need to validate a text field in a form (you can enter only text and no spaces). But I have a iso-8859-2 character set and Croatian letters don't pass validation. Here is a piece of code: $result = ereg ("^[A-Za-z0-9]+$", $input); Any help appreciated. Zvonko Bok! |
|
|||
|
You can add croatian letter to the list of allowed chars: $result = ereg ("^[A-Za-z0-9??????????]+$", $input); Greetings from slovenia! ;) An?e Zvonko Biškup wrote: > Hi! > > I need to validate a text field in a form (you can enter only text and no > spaces). > But I have a iso-8859-2 character set and Croatian letters don't pass > validation. > Here is a piece of code: > > $result = ereg ("^[A-Za-z0-9]+$", $input); > > Any help appreciated. > Zvonko > > Bok! |
![]() |
| Thread Tools | |
| Display Modes | |
|
|