Suchy Posted May 29, 2008 Share Posted May 29, 2008 foreach($stuff as $x) echo $x['letters'] . ","; This prints out something like: a,d,f,a,e,f,a,a,a,f,v,m, How can I print only unique entries? a,d,f,e,v,m, Link to comment https://forums.phpfreaks.com/topic/107742-unique-records-with-foreach/ Share on other sites More sharing options...
Barand Posted May 29, 2008 Share Posted May 29, 2008 <?php $letters = array(); foreach($stuff as $x) $results[] = $x['letters']; echo join(',', array_unique($results)); Link to comment https://forums.phpfreaks.com/topic/107742-unique-records-with-foreach/#findComment-552350 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.