Oh, I thought I'd join in.
function is_alphabetical($string)
{
return strspn(
strtolower($string),
'abcdefghijklmnopqrstuvwxyz'
)==strlen($string);
}
No, no questions here; the manual explains it all. The important question is: which one is most legible?
Observing that the two original posts aren't even functional (funny, that - I wonder why): an even faster simulation would be
function is_alphabetical($char)
{ trigger_error('Whatever the error message is here', E_USER_WARNING);
}