How to exclude duplicate content from this piece of code? [closed]

imminnocrus

New Member
hope someone can help me out with this piece of code:\[code\]<?php$righe_msg = file("dati.txt");$num = 5;$selected = array(); while (count($selected)!=$num){ $rand = rand(0,count($righe_msg)-1); $selected[$rand] = $righe_msg[];}$numero=0; foreach ($selected as $sel){ $dato = explode("|", trim($sel)); if (trim($dato[5])=="yes") { $numero++; echo"<tr><td bgcolor='#EEEEEE'>&raquo; <a href='http://stackoverflow.com/questions/10554854/$dato[2]'> $dato[1]</a></td></tr> "; }}?>\[/code\]It's working ok, but sometimes it's pulling out duplicate content.
 
Back
Top