I had a function which is pulling all the dates from database against each record.
public function getAllYears() {
$collection = Mage::getModel('press/press')->getCollection()->getYears();
return $collection;
}
and am displaying it as :
<?php
$coll = $this->getAllYears();
?>
<?php foreach ($coll as $list): ?>
<?php echo $list["year"]; ?>
<?php endforeach; ?>
It is giving me all the years(dates), without caring for repetition, whereas I want is same date must not be repeated.
Mean same year must not repeat.
Any help?
Perhaps change the display code to: