Re: PHP 4.0 Bug #6684: array_reverse() should maintain indices
| From: | Andrei Zmievski | Date: | Tue, 12 Sep 2000 18:45:37 +0000 |
| Subject: | Re: PHP 4.0 Bug #6684: array_reverse() should maintain indices | ||
| References: | 1 2 3 | Groups: | php.dev |
| Request: | Send a blank email to php-dev+get-33095@lists.php.net to get a copy of this message | ||
On Tue, 12 Sep 2000, André Langhorst wrote:
> $array=range(30,50);
> // creating an array where keys=value is a ord=chr relation
> foreach ($array AS $val) $chr_array[$val]=chr($val);
> // now I simply want to reverse it
> $r_array=array_reverse($chr_array);
> var_dump($r_array);
>
> wow, we´ve lost our ord=chr relation,
> hope it conviced
Ok. I'll add an optional argument 'preserve_keys'.
-Andrei
"Later in this talk, I intend to define
the universe and give three examples." -- Larry Wall