Something like this will sort each line by alphabetical order.
<?
$file = file("filename.txt");
sort($file);
$fp = fopen("filename.txt","w");
for($count=0;$count<count($file);$count++)
{
fputs($fp,$file[$count]);
}
fclose($fp);
?>
The only issue with sort is that it sorts in ascii order, so AC is before Ab. I just picked that up in a comment on the manual page for sort(). If all of your links are in the form, www.something.com, all lowercase, then it shouldn't be an issue. If they're not lowercase, then you should use the strtolower() funtion when you save them, to make sure they are all lowercase.
---John Holmes...