Forum Moderators: coopster
<?php
$zipCodes = array(); // Array to store all the unique zipcodes we output
foreach($houses as $house) {
// Is this zipcode already in the array? If so, skip it
if (isset($zipCodes[$house->zipcode])) {continue;}
?>
<li><?=$house->zipcode?></li>
<?php
// Record this zipcode in the array
$zipCodes[$house->zipcode] = true;
}
?>