Gossamer Forum
Home : General : Internet Technologies :

Breaking Up a Line using PHP

Quote Reply
Breaking Up a Line using PHP
Is there anyway to break up a line like the following using PHP coding?

Gen:1:1: In the beginning God created the heaven and the earth.

I want to break this line up into Book, Chapter, Verse, and actual Verse. This line has colons for this specific reason, however using the split() function is only splitting up the book names and deleting what is left over. Here is the code I've been using, I know it's not what I want to do but will illustrate the example I'm speaking of.

Code:
<?$text = file("OT.dat");
for ($index=0; $index < count($text); $index++)
{

$textlist = split(":", chop($text[$index]));
echo ($textlist[0] . "<br />");
}
?>


Any help what so ever is much appreciated.
Subject Author Views Date
Thread Breaking Up a Line using PHP JoFrRi 15612 Aug 23, 2003, 6:03 PM
Thread Re: [JoFrRi] Breaking Up a Line using PHP
Mark Badolato 15231 Aug 23, 2003, 10:59 PM
Thread Re: [Mark Badolato] Breaking Up a Line using PHP
Andy 15206 Aug 24, 2003, 1:36 AM
Thread Re: [Andy] Breaking Up a Line using PHP
Mark Badolato 15274 Aug 24, 2003, 10:06 AM
Thread Re: [Mark Badolato] Breaking Up a Line using PHP
Andy 15327 Aug 24, 2003, 11:25 PM
Thread Re: [Andy] Breaking Up a Line using PHP
JoFrRi 15238 Aug 25, 2003, 1:17 PM
Thread Re: [JoFrRi] Breaking Up a Line using PHP
Andy 15242 Aug 25, 2003, 11:38 PM
Thread Re: [Andy] Breaking Up a Line using PHP
Mark Badolato 15203 Aug 26, 2003, 12:32 AM
Thread Re: [Mark Badolato] Breaking Up a Line using PHP
Andy 15209 Aug 26, 2003, 12:34 AM
Thread Re: [Andy] Breaking Up a Line using PHP
Mark Badolato 15191 Aug 26, 2003, 12:36 AM
Thread Re: [Mark Badolato] Breaking Up a Line using PHP
Andy 15149 Aug 26, 2003, 12:42 AM
Thread Re: [Andy] Breaking Up a Line using PHP
Mark Badolato 15139 Aug 26, 2003, 8:13 AM
Post Re: [Mark Badolato] Breaking Up a Line using PHP
Andy 15068 Aug 26, 2003, 8:14 AM
Thread Re: [Mark Badolato] Breaking Up a Line using PHP
hennagaijin 15095 Aug 26, 2003, 8:41 AM
Thread Re: [hennagaijin] Breaking Up a Line using PHP
JoFrRi 15063 Aug 26, 2003, 3:01 PM
Thread Re: [JoFrRi] Breaking Up a Line using PHP
hennagaijin 15133 Aug 26, 2003, 3:10 PM
Thread Re: [hennagaijin] Breaking Up a Line using PHP
JoFrRi 15175 Aug 26, 2003, 3:36 PM
Thread Re: [JoFrRi] Breaking Up a Line using PHP
hennagaijin 15208 Aug 27, 2003, 11:12 AM
Thread Re: [hennagaijin] Breaking Up a Line using PHP
Andy 15185 Aug 27, 2003, 11:19 AM
Post Re: [Andy] Breaking Up a Line using PHP
JoFrRi 15041 Aug 27, 2003, 6:17 PM
Post Re: [Andy] Breaking Up a Line using PHP
JoFrRi 15162 Aug 25, 2003, 3:22 PM