Skip to content
Advertisement

ereg(“^[0-9a-z] restricts only 0-9 and a-z character what about other language character

I have a form and I want to allow users with all character without any space . so I was using this for english character

ereg("^[0-9a-z] 

but later I have decided to allow other character of different languages like arabic, spanish, chinese so I have removed this restriction but after that users started registering with a username with space and for that my website is showing page not found. so can you please advice what I should use so that I can allow users with different languages to signup for my site

Advertisement

Answer

ereg("[^s]")

^s means any character except space.

But please note that ereg is deprecated. You should look into preg_* functions.

User contributions licensed under: CC BY-SA
4 People found this is helpful
Advertisement