|
ctype_alpha
Check for alphabetic character(s)
(PHP 4 >= 4.0.4, PHP 5)
Checks if all of the characters in the provided string,
text, are alphabetic.
In the standard Return Values
Returns ExamplesExample 417. A ctype_alpha() example (using the default locale)<?php The above example will output: The string KjgWZC consists of all letters.
See Also
Code Examples / Notes » ctype_alphalxg
A little replacement function: <?php if ( !function_exists('ctype_alpha') ) { function ctype_alpha($string) { if ( !preg_match('|[^\pL]|', $string) ) /* alternative: */ // if ( !preg_match('|[^A-Za-z]|', $string) ) return true; else return false; } } ?> |