PHP 4.0 Bug #7360: is_a2z would be nice...
| From: | maxim at maxim dot cx | Date: | Fri, 20 Oct 2000 06:24:38 +0000 |
| Subject: | PHP 4.0 Bug #7360: is_a2z would be nice... | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-35621@lists.php.net to get a copy of this message | ||
From: maxim@maxim.cx
Operating system: Linux
PHP version: 4.0.3
PHP Bug Type: Feature/Change Request
Bug description: is_a2z would be nice...
A suggestion:
I was thinking that there are some functions that should exist in PHP:
1: if(eregi("[A-Z]", $string)) this could be called something like is_a2z (any name is OK,
I just though about nl2br). Instead of using RegEx which is real slow when you have to check strings
several times in a script a simple function like this would be of a BIG HELP. (I know of
is_numeric(), but it's use will not make you sure that the string is esclusivelly alphabetic).
A build-in function to detect whether a $string is entirelly made from a-z avoiding so regular
expression use is really needed, I think.
2: Another thing (Less important) is that instead of using (ereg("[:alnum:]", $string))
you could just say if(!is_almun($string)), just to make (ereg("[:alnum:]", $string)) be a
little lighter and easier for beginners. (few beginners use [:almun:], they usually get into writing
some huge long expressions,) this would impress them a lot.
Thanks for your patience,
Maxim Maletsky
--
Edit Bug report at: http://bugs.php.net/?id=7360&edit=1