I am building a drop down menu of cities from an xml file.
Because the xml file contain duplication I used the function in array to make sure I don't echo twice the same value.

This is the code:
	echo "<select>";
	foreach ($xmlDiurPlus->propertyList as $propertylist){
		if (!in_array($propertylist->city,$cities)){
			echo '<option value="'.$propertylist->city.'">'.$propertylist->city.'</option>';			
	echo "</select> ";
Yet when I run it, I still get the same value more than once.

Where is my mistake?