<?php $file="checked.txt"; $_file=file($file); $_file=array_values(array_unique($_file)); $fp=fopen($file,"w+"); for($i=0;$i<count($_file);$i++) { flush(); fputs($fp,$_file[$i]); } echo "done<br>"; flush(); fclose($fp); ?>