tags:

views:

40

answers:

1

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
)
+7  A: 

Use array_unique:

$a2 = array_unique($a);
Mikael S
You're **TWO seconds** faster!!!
BoltClock
Arg, 12 seconds for me :/
Anthony Forloney