|
ctype_alpha
Check for alphabetic character(s)
(PHP 4 >= 4.0.4, PHP 5)
Example 417. A ctype_alpha() example (using the default locale)<?php The above example will output: The string KjgWZC consists of all letters. 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; } } ?> |