Re: array_reverse() recursive
| From: | Stuart Dallas | Date: | Mon, 10 Jun 2002 16:12:50 +0000 |
| Subject: | Re: array_reverse() recursive | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-101396@lists.php.net to get a copy of this message | ||
Monday, June 10, 2002, 5:07:48 PM, you wrote:
> Does anyone have or know of a function that will take an array and
> do array_reverse() recursively? I have the following array/structure:
Something like this (UNTESTED!!)...
function recursive_array_reverse($arr)
{
foreach ($arr as $key => $val)
{
if (is_array($val))
$arr[$key] = recursive_array_reverse($val);
}
return $arr;
}
Let me know if this works.
--
Stuart