Including Text File in PHP/HTML Template
| From: | Rick Beckman | Date: | Mon, 30 Sep 2002 09:39:49 +0000 |
| Subject: | Including Text File in PHP/HTML Template | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-118272@lists.php.net to get a copy of this message | ||
I have a series of text files that are set up with each line being a
different field. Line "0" is song title, "1" is artist, "2" is album,
and so
forth. I know how to use PHP to include those files in an HTML template
using 'echo' so that I don't have to make a separate page for each song,
however, I do have two problems:
On line "6", I have the list of musicians in the song.
Example (ignore the quotes): "Doyle Lawson -- lead vocal; Dale Perry -- bass
vocal"
Is there a way to make it so that, when I include line 6 in my PHP template,
the ";" will be replaced with a line break so I get one musician per line in
the HTML output?
Lines 7 and so on are the lyrics. The text file has one line per line (makes
sense, right?) and a blank line between sections of the song. I have the
script set up to read all the lines from 7 on, but it jumbles them all
together, ignoring the line breaks. Is there a way to script PHP to add the
line breaks, or should the line break HTML just be inserted everywhere
needed in all my separate files?
All help is appreciated!
--
Kyrie Eleison,
Rick
www.spiritsword.com/phpBB2/
---
Outgoing mail is certified Virus Free because I care. Jesus Saves!
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.391 / Virus Database: 222 - Release Date: 9/19/02