0

Possible Duplicate:
How to remove duplicate values from an array in PHP

How can I remove all multiple values for example 55,55 will only be 55 using PHP

Example 1

Array
(
    [0] => 9
    [1] => 2
    [2] => 55
    [3] => 55
    [4] => 9
)

Example 1 should look like example 2 below.

Array
(
    [0] => 9
    [1] => 2
    [2] => 55
)
Community
  • 1
  • 1
HELP
  • 14,237
  • 22
  • 66
  • 100
  • duplicate of [How to remove duplicate values from an array in PHP](http://stackoverflow.com/questions/307650/how-to-remove-duplicate-values-from-an-array-in-php) – Gordon Oct 16 '10 at 20:56

1 Answers1

7

Use array_unique:

$a2 = array_unique($a);
Mikael S
  • 5,206
  • 2
  • 23
  • 21