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 21312 Aug 23, 2003, 6:03 PM
Thread Re: [JoFrRi] Breaking Up a Line using PHP
Mark Badolato 20834 Aug 23, 2003, 10:59 PM
Thread Re: [Mark Badolato] Breaking Up a Line using PHP
Andy 20832 Aug 24, 2003, 1:36 AM
Thread Re: [Andy] Breaking Up a Line using PHP
Mark Badolato 20892 Aug 24, 2003, 10:06 AM
Thread Re: [Mark Badolato] Breaking Up a Line using PHP
Andy 20991 Aug 24, 2003, 11:25 PM
Thread Re: [Andy] Breaking Up a Line using PHP
JoFrRi 20949 Aug 25, 2003, 1:17 PM
Thread Re: [JoFrRi] Breaking Up a Line using PHP
Andy 20857 Aug 25, 2003, 11:38 PM
Thread Re: [Andy] Breaking Up a Line using PHP
Mark Badolato 20808 Aug 26, 2003, 12:32 AM
Thread Re: [Mark Badolato] Breaking Up a Line using PHP
Andy 20821 Aug 26, 2003, 12:34 AM
Thread Re: [Andy] Breaking Up a Line using PHP
Mark Badolato 20810 Aug 26, 2003, 12:36 AM
Thread Re: [Mark Badolato] Breaking Up a Line using PHP
Andy 20757 Aug 26, 2003, 12:42 AM
Thread Re: [Andy] Breaking Up a Line using PHP
Mark Badolato 20832 Aug 26, 2003, 8:13 AM
Post Re: [Mark Badolato] Breaking Up a Line using PHP
Andy 20672 Aug 26, 2003, 8:14 AM
Thread Re: [Mark Badolato] Breaking Up a Line using PHP
hennagaijin 20720 Aug 26, 2003, 8:41 AM
Thread Re: [hennagaijin] Breaking Up a Line using PHP
JoFrRi 20676 Aug 26, 2003, 3:01 PM
Thread Re: [JoFrRi] Breaking Up a Line using PHP
hennagaijin 20758 Aug 26, 2003, 3:10 PM
Thread Re: [hennagaijin] Breaking Up a Line using PHP
JoFrRi 20790 Aug 26, 2003, 3:36 PM
Thread Re: [JoFrRi] Breaking Up a Line using PHP
hennagaijin 20897 Aug 27, 2003, 11:12 AM
Thread Re: [hennagaijin] Breaking Up a Line using PHP
Andy 20798 Aug 27, 2003, 11:19 AM
Post Re: [Andy] Breaking Up a Line using PHP
JoFrRi 20647 Aug 27, 2003, 6:17 PM
Post Re: [Andy] Breaking Up a Line using PHP
JoFrRi 20759 Aug 25, 2003, 3:22 PM