Monday, March 12, 2012

How to remove duplicate values from an array in PHP



If you have duplicated values in array, and you wonder how to clean it.

Easy !

There is a function which solves the problem.

Function calls array_unique

Use:
$clean_array = array_unique($array);
Source: http://php.net/manual/en/function.array-unique.php