

apower said:i have a somewhat larg txt file that has song list in it however there are tons of Duplicates is there an easy way to get rid of the Duplicates?
<?php
$filename = "songs.txt";
$handle = fopen($filename, "r");
$contents = fread($handle, filesize($filename));
fclose($handle);
$list = explode('\n', $contents);
$result = array_unique($list);
foreach($result as $key=>$value) {
echo $value . "<br />";
}
?>
