Use array_unique().
Example:
$array = array(1, 2, 2, 3);
$array = array_unique($array); // Array is now (1, 2, 3)
More Related Contents:
- How to remove duplicate values from a multi-dimensional array in PHP
- PHP create new array by value
- Get first and second element of array [duplicate]
- PHP Multidimensional associative array to HTML table
- count how many duplicate keys are in array of objects?
- How do I create a comma-separated list from an array in PHP?
- Array to String PHP?
- PHP array delete by value (not key)
- How do you remove an array element in a foreach loop?
- How to insert an item at the beginning of an array in PHP?
- How to sort a date array in PHP
- PHP hierarchical array – Parents and childs
- PHP Sort array by field? [duplicate]
- Get the keys for duplicate values in an array
- How can you make a multidimensional array unique? [duplicate]
- Efficiently pick n random elements from PHP array (without shuffle)
- How to sort an array of arrays in php?
- PHP get index of last inserted item in array
- php array find duplicates, sum them up & delete duplicates
- Search and replace multiple values with multiple/different values in PHP5?
- PHP Recursively unset array keys if match
- $_POST max array size
- PHP: Get the key from an array in a foreach loop [duplicate]
- Efficiency of using foreach loops to clear a PHP array’s values
- Find min/max in a two dimensional array
- how to sort a multidemensional array by an inner key
- How to iterate through a nested stdClass? [duplicate]
- How to get the object or class name?
- Group array data on one column and sum data from another column to form a flat associative array
- Convert delimited string into array key path and assign value