Only a-z, A-Z and 0-9 in $var?

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
InternetX
Forum Newbie
Posts: 22
Joined: Tue Jan 21, 2003 1:57 pm
Location: Germany
Contact:

Only a-z, A-Z and 0-9 in $var?

Post by InternetX »

How can I check if a variable has only a-z, A-Z and 0-9?
So that on every other input an error occured?

Sorry for my english... -.-...
User avatar
twigletmac
Her Royal Site Adminness
Posts: 5371
Joined: Tue Apr 23, 2002 2:21 am
Location: Essex, UK

Post by twigletmac »

InternetX
Forum Newbie
Posts: 22
Joined: Tue Jan 21, 2003 1:57 pm
Location: Germany
Contact:

Post by InternetX »

Thanks...
McGruff
DevNet Master
Posts: 2893
Joined: Thu Jan 30, 2003 8:26 pm
Location: Glasgow, Scotland

Post by McGruff »

or ctype_alnum()
InternetX
Forum Newbie
Posts: 22
Joined: Tue Jan 21, 2003 1:57 pm
Location: Germany
Contact:

Post by InternetX »

Thanks :-)
It works
Post Reply