tags:

views:

165

answers:

2

I've got an array like this one:

arrayname[1] = "jacob";
arrayname[2] = "peter";
arrayname[3] = "jacob";
arrayname[4] = "nicholas";

I want to remove the double jacob so it will be like

arrayname[1] = "jacob";
arrayname[2] = "peter";
arrayname[3] = "nicholas";

How do I do that?

+9  A: 

array_unique()

Pekka
+2  A: 
$array = array_unique($array);
Rob