View Single Post
Old 10-27-2009, 03:22 AM   #4 (permalink)
delayedinsanity
is cute and cuddly
 
delayedinsanity's Avatar
 
Join Date: Mar 2008
Location: Vegas, Baby
Posts: 963
Thanks: 31
delayedinsanity is on a distinguished road
Default

That takes all the fun out of learning. :)

php Code:
$myFile = "testFile.txt";
$fh = fopen($myFile, 'r');
$theData = fread($fh, filesize($myFile));
fclose($fh);

Would be...

php Code:
$myFile = 'testFile.txt';
$theData = array_reverse( file( $myFile ) );

foreach ( $theData as $row )
    echo $row . '<br />';

Or however you wish. There's about 3,141.59265 ways to do anything in PHP.
delayedinsanity is offline  
Reply With Quote