php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #7360 is_a2z would be nice...
Submitted: 2000-10-20 02:24 UTC Modified: 2001-01-21 03:43 UTC
From: maxim at maxim dot cx Assigned:
Status: Closed Package: Feature/Change Request
PHP Version: 4.0.3 OS: Linux
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: maxim at maxim dot cx
New email:
PHP Version: OS:

 

 [2000-10-20 02:24 UTC] maxim at maxim dot cx
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

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2000-10-20 05:59 UTC] hholzgra@php.net
what about implementing the ctype.h family of functions
available in C and stick with their namespace ?

      isalnum,  isalpha,  isascii,  isblank,  iscntrl,  isdigit,
       isgraph,  islower,  isprint,  ispunct,  isspace,  isupper,
       isxdigit
 [2001-01-21 03:43 UTC] cynic@php.net
ctype functions are now implemented
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Mon Apr 28 00:01:29 2025 UTC