Character Validation

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
Zorth
Forum Commoner
Posts: 76
Joined: Fri Feb 20, 2004 8:00 pm

Character Validation

Post by Zorth »

Hey,

I checked the PHP manual first of all. I didn't see anything for what I'm looking for, though maybe I'm just blind?

Basically, I need a function that will return either true or false if the character I send it as an argument is a letter, like C++'s isalpha().

Anyone know of such a function? I'd make my own, though I don't think I know how to grab the ASCII value of a character either :(

Thanks.
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

Look at the ctype functions:

http://php.net/ref.ctype
Zorth
Forum Commoner
Posts: 76
Joined: Fri Feb 20, 2004 8:00 pm

Post by Zorth »

Thank you. This is exactly what I was looking for.
Post Reply