note 29045 deleted from function.array-reverse by salathe
| From: | salathe@php.net | Date: | Fri, 08 Jun 2012 20:09:57 +0000 |
| Subject: | note 29045 deleted from function.array-reverse by salathe | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-188483@lists.php.net to get a copy of this message | ||
Note Submitter: m dot weber at luna-park dot de
----
If you want to reverse an array with numerical indexes, you can keep them by using following code:
<?php
end($gruppenarr);
do {
$part1=key($gruppenarr);
$part2=current($gruppenarr);
$gruppenarr2[$part1]=$part2;
} while(prev($gruppenarr));
?>
input is $gruppenarr
output is $gruppenarr2