note 77542 added to function.array-values
| From: | deceze at gmail dot YesThatsGoogleMail dot com | Date: | Mon, 03 Sep 2007 07:31:30 +0000 |
| Subject: | note 77542 added to function.array-values | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-130115@lists.php.net to get a copy of this message | ||
Please note that 'wellandpower at hotmail.com's recursive merge doesn't work.
Here's the fixed version:
<?php
function array_values_recursive($array) {
$flat = array();
foreach ($array as $value) {
if (is_array($value)) $flat = array_merge($flat, array_values_recursive($value));
else $flat[] = $value;
}
return $flat;
}
?>
----
Server IP: 61.195.146.164
Probable Submitter: 125.103.66.6
----
Manual Page -- http://www.php.net/manual/en/function.array-values.php
Edit -- https://master.php.net/note/edit/77542
Del: integrated -- https://master.php.net/note/delete/77542/integrated
Del: useless -- https://master.php.net/note/delete/77542/useless
Del: bad code -- https://master.php.net/note/delete/77542/bad+code
Del: spam -- https://master.php.net/note/delete/77542/spam
Del: non-english -- https://master.php.net/note/delete/77542/non-english
Del: in docs -- https://master.php.net/note/delete/77542/in+docs
Del: other reasons-- https://master.php.net/note/delete/77542
Reject -- https://master.php.net/note/reject/77542
Search -- https://master.php.net/manage/user-notes.php