Jump to content

script to count and remove duplicate lines in file


devWhiz

Recommended Posts

$filename = 'user_ids.txt';
$text = array_unique(file($filename));
$userids = @fopen($filename,'w+');
if($userids)
{
  fputs($userids, join('',$text));
  fclose($userids);
}

 

would what you said be more efficient than this?

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.