![]() |
Removing dulicates during echo - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23) +--- Thread: Removing dulicates during echo (/showthread.php?tid=58059) |
Removing dulicates during echo - El Forum - 05-10-2013 [eluser]davehedgehog[/eluser] hi basically what im trying todo is remover the venue where it repeats its self during and echo. at the moment it work but for only the next entry because or the for each. heres the code~ Code: <?php $prevenue=false;?><?php $pretitle=false;?> I want to change this to a while so that for every echo if the venue is there then dont repeat, but when I try while it falls over, any help? Removing dulicates during echo - El Forum - 05-13-2013 [eluser]MonkeyZeus[/eluser] I assume you are retrieving this data from a DB so I would personally try and modify the query to only pull the results that you need. However, for your situation I would implement something like this: Code: $unique_venues = array(); Good Luck! Removing dulicates during echo - El Forum - 05-14-2013 [eluser]davehedgehog[/eluser] awesome cheers pal =) |