note 78420 deleted from function.array-unique by danbrown
| From: | danbrown@php.net | Date: | Sun, 23 Jan 2011 17:21:19 +0000 |
| Subject: | note 78420 deleted from function.array-unique by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-176186@lists.php.net to get a copy of this message | ||
Note Submitter: array_unique_FULL
----
<?php
function array_unique_FULL($array) {
foreach($array as $k => $v) {
if (is_array($v)) {
$ret = array_unique_FULL(array_merge($ret, $v));
} else {
$ret[$k] = $v;
}
} //for
return array_unique($ret);
}
?>
Array
(
[0] => js/pt.js
[1] => js/selectfile.js
[2] => js/pt.js
[3] => js/proyecto.js
[4] => Array
(
[0] => Array
(
[0] => js/selectfile.js
[1] => js/selectfile.js
[2] => js/y otro mas.js
)
[1] => q se yo
)
)
go array_unique_FULL()!!!!
Array
(
[0] => js/pt.js
[1] => js/selectfile.js
[3] => js/proyecto.js
[6] => js/y otro mas.js
[5] => q se yo
)