Re: Re: [PHP] reading txt file - certain lines
| From: | Dustin Krysak | Date: | Thu, 29 Jul 2004 02:55:58 +0000 |
| Subject: | Re: Re: [PHP] reading txt file - certain lines | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-192142@lists.php.net to get a copy of this message | ||
Yeah I do not really have the option to use a database here since the way the data is output is limited to a text file...... the files are populated by a program that takes the currently playing tracks out of Itunes (mp3 player) on my mac.
d
On 28-Jul-04, at 3:26 PM, php-general-digest-help@lists.php.net wrote:
From: John Nichel <john@kegworks.com> Date: July 28, 2004 2:05:51 PM PDT To: PHP <php-general@lists.php.net> Subject: Re: [PHP] reading txt file - certain lines Dustin Krysak wrote:Hi there.. .I am displaying info (on music) from a text file with the following code... <?php //open the file handler $fp02=fopen("assets/lib/php/itunes/recent.txt","r"); //Read the track info $recent=fgets($fp02); //close the file. echo "$recent"; fclose($fp02); ?> Now the contents of said text file would read something like the following: <b>Liar</b><br>by <i><b>Sex Pistols</b><i><br><i>"Never Mind The Bollocks"</i><br>Played: 2004/07/28, 1:48:29 PM<br>----------<br><b>Let's Rave On</b><br>by <i><b>The Raveonettes</b><i><br><i>"Chain Gang Of Love"</i><br>Played: 2004/07/28, 1:46:37 PM<br>----------<br><b>No Remorse</b><br>by <i><b>Metallica</b><i><br><i>"Kill 'Em All"</i><br>Played: 2004/07/28, 1:40:17 PM<br>----------<br><b>This Is Our Emergency</b><br>by <i><b>Pretty Girls Make Graves</b><i><br><i>"The New Romance"</i><br>Played: 2004/07/28, 1:36:37 PM<br>----------<br><b>Freestylin'</b><br>by <i><b>Greyboy</b><i><br><i>"Freestylin'"</i><br>Played: 2004/07/28, 1:30:25 PM<br>----------<br><b>In My Head</b><br>by <i><b>Naked Raygun</b><i><br><i>"Raygun...Naked Raygun (Reissue)"</i><br>Played: 2004/07/28, 1:26:37 PM<br>----------<br><b>Lust To Love</b><br>by <i><b>The Go-Go's</b><i><br><i>"Return To The Valley Of The Go-Go's"</i><br>Played: 2004/07/28, 1:23:13 PM<br>----------<br><b>Kim You Bore Me To Death</b><br>by <i><b>Grandaddy</b><i><br><i>"Concrete Dunes"</i><br>Played: 2004/07/28, 1:18:37 PM<br>----------<br><b>Sonderkommando</b><br>by <i><b>Gwar</b><i><br><i>"This Toilet Earth"</i><br>Played: 2004/07/28, 1:13:49 PM<br>----------<br> Now what I want to do is read this file, but only say read 5 songs worth, then I would place the PHP code in (another table) and display the next 5 songs and so on.... This just allows for a more flexible layout in the final presentation. the way I am having the text files written, there is no way to get it to produce seperate text files - otherwise this would be easy to do.... Is this possible?Yes, possible. Worth the time? No. Can you put all that info in a database? -- John C. Nichel ÜberGeek KegWorks.com 716.856.9675 john@kegworks.com