note 78420 modified in function.array-unique by james
| From: | james@php.net | Date: | Fri, 19 Oct 2007 02:09:50 +0000 |
| Subject: | note 78420 modified in function.array-unique by james | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-131524@lists.php.net to get a copy of this message | ||
<?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
)
--was--
<?php function array_unique_FULL($array){
foreach($array as $k => $v){
if(is_array($v)){
$ret=F::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
)
http://php.net/manual/en/function.array-unique.php