note 74471 deleted from function.array-unique by danbrown
| From: | danbrown@php.net | Date: | Sun, 23 Jan 2011 17:22:10 +0000 |
| Subject: | note 74471 deleted from function.array-unique by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-176191@lists.php.net to get a copy of this message | ||
Note Submitter: danny at lostsockdesign dot com dot au
----
An updated version of webcreators script that fixes a notice error about an undefined index and
removes blank array value.
<?php
function my_array_unique($from) {
for ($i=count($from)-1;$i>1;$i--) {
$last = $from[$i];
$from[$i] = false;
if (!in_array($last,$from)) {
$from[$i]=$last;
}
}
$from = array_unique($from);
$from = array_slice($from,0,count($from)-1);
return $from;
}
?>