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 ctypealpha() does precisely the same thing. However, I still believe there should be a standard function having prefix ‘is’ for alphabets too.

Cheers

Published
Categorized as php

Leave a comment

Your email address will not be published.