RE: [PHP] using eregi

From: Date: Thu, 31 Jan 2002 13:52:29 +0000
Subject: RE: [PHP] using eregi
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-82925@lists.php.net to get a copy of this message
You could do it like this: <? $aTextFileArray = file("your_file.txt"); $firstLineToPrint = 5; $lastLineToPrint = 10; for ($i = $firstLineToPrint; $i < count($aTextFileArray) || $i < $lastLineToPrint; $i++) { print "Line $i: ".$aTextFileArray[$i]."<br>"; }; ?> Niklas -----Original Message----- From: John Gurley [mailto:john_g83@hotmail.com] Sent: 31. tammikuuta 2002 15:32 To: php-general@lists.php.net Subject: [PHP] using eregi Hello, Just wondering if there is a way to print out parts of a text file (i.e from line x to line y) using php, the way it is being done now is using eregi and comparing strings, but it would be alot better if I could specify which lines to print. Thanks a million. _________________________________________________________________ Chat with friends online, try MSN Messenger: http://messenger.msn.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net For additional commands, e-mail: php-general-help@lists.php.net To contact the list administrators, e-mail: php-list-admin@lists.php.net

« previous php.general (#82925) next »