PHP_Compat: Addition of in_array_nocase (was: [ANNOUNCEMENT] PHP_Compat-1.0.0 (stable) Released.)
| From: | Stefan Neufeind | Date: | Sat, 12 Jun 2004 14:15:12 +0000 |
| Subject: | PHP_Compat: Addition of in_array_nocase (was: [ANNOUNCEMENT] PHP_Compat-1.0.0 (stable) Released.) | ||
| References: | 1 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-30562@lists.php.net to get a copy of this message | ||
Well, depends on how soon this feature will be introduced. Can't we
delay adding it to PHP_Compat let's say 2 or 3 month from now when it
could be available in php5? Or do I make too optimistic assumptions
for the respective php-version?
On 12 Jun 2004 at 21:42, Aidan Lister wrote:
> Perhaps another package, PHP_Utilities?
>
>
> "Klaus Guenther" <klaus@capitalfocus.org> wrote in message
> news:40C9A233.5030506@capitalfocus.org...
> > PEAR Announce wrote:
> >
> > >The new PEAR package PHP_Compat-1.0.0 (stable) has been released at
> http://pear.php.net/.
> > >
> > >Release notes
> > >-------------
> > >Added more components:
> > >* array_change_key_case
> > >* array_chunk
> > >* array_diff_assoc
> > >* vprintf
> > >* vsprintf
> > >* var_export
> > >
> > >Fixed behaviour of stripos/strripos. Searches for whole needle.
> > >
> > >Package Info
> > >-------------
> > >PHP_Compat provides missing functionality in the form of Constants and
> Functions for older versions of PHP.
> > >
> > >Constants:
> > >* E_STRICT
> > >* PATH_SEPERATOR
> > >
> > >
> >
> > Ouch... that should be "PATH_SEPARATOR"...
> >
> > >* STDIN, STDOUT, STDERR
> > >* FILE_USE_INCLUDE_PATH, FILE_IGNORE_NEW_LINES, FILE_SKIP_EMPTY_LINES,
> FILE_APPEND, FILE_NO_DEFAULT_CONTEXT
> > >
> > >Functions:
> > >* array_change_key_case
> > >* array_chunk
> > >* array_combine
> > >* array_diff_assoc
> > >* array_udiff
> > >* array_udiff_assoc
> > >* file_get_contents
> > >* file_put_contents
> > >* fprintf
> > >* http_build_query
> > >* is_a
> > >* scandir
> > >* str_ireplace
> > >* str_split
> > >* stripos
> > >* strripos
> > >* var_export
> > >* vprintf
> > >* vsprintf
> > > Schmidt <schst@php.net> (developer)
> > >
> > >
> >
> > One thing I'd love to see in here is a non-existant PHP function...
> >
> >
> > function in_array_nocase($string, $array, $separator = '@#@')
> > {
> > $arr_str = $separator . strtolower(implode($separator, $array)) .
> > $separator;
> > $string = $separator . strtolower($string) . $separator;
> > if(strpos($arr_str, $string) !== false) {
> > return true;
> > }
> > return false;
> > }
> >
> > It's something that's badly needed since get_class* returns a case
> > sensitive array. This is the fastest implementation (see
> > http://pixelated-dreams.com/blog/archive/000053.html for
> > details).