cheesycarrion Posted February 7, 2008 Share Posted February 7, 2008 <?php $textfile = asort(file("file.txt")); foreach ($textfile as $line_num => $line) { echo $line . "\n"; ?> goal: sort each line of a text document alphabetically Quote Link to comment Share on other sites More sharing options...
marcus Posted February 7, 2008 Share Posted February 7, 2008 <?php $file = file('file.txt'); asort($file); foreach($file AS $line){ echo $line . "<br>\n"; } ?> file.txt you make lemons taste bad results: bad lemons make taste you Quote Link to comment Share on other sites More sharing options...
cheesycarrion Posted February 7, 2008 Author Share Posted February 7, 2008 thanks for the quick response. In soviet russia bad lemons make taste you! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.