note 51607 modified in function.array-unique by levim
| From: | levim@php.net | Date: | Sun, 20 Dec 2015 05:10:25 +0000 |
| Subject: | note 51607 modified in function.array-unique by levim | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-204492@lists.php.net to get a copy of this message | ||
A very simple way of getting rid of duplicate entries and re-indexing with key starting at 0:
<?php
$temp = array_unique($main);
$uniq = array_values($temp);
?>
--was--
A very simple way of getting rid of duplicate entries and re-indexing with key starting at 0:
<?php
$temp=array_unique($main);
$main=array_values($temp);
?>
http://php.net/manual/en/function.array-unique.php