Missing alphabet check (is_alpha) in PHP

Well, you might have seen a huge number of variable checks ranging from is_file(), is_array() to is_numeric() and is_int(). While developing a script today I wanted to check for alphabets. I directly used is_alpha() but to my surprise it wasn’t defined.

I researched more into the matter and found ctype_alpha() does precisely the same thing. However, I still believe there should be a standard function having prefix ‘is_’ for alphabets too.

Cheers

Leave a Reply

Your email address will not be published. Required fields are marked *