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 16034 Aug 23, 2003, 6:03 PM
Thread Re: [JoFrRi] Breaking Up a Line using PHP
Mark Badolato 15639 Aug 23, 2003, 10:59 PM
Thread Re: [Mark Badolato] Breaking Up a Line using PHP
Andy 15614 Aug 24, 2003, 1:36 AM
Thread Re: [Andy] Breaking Up a Line using PHP
Mark Badolato 15689 Aug 24, 2003, 10:06 AM
Thread Re: [Mark Badolato] Breaking Up a Line using PHP
Andy 15735 Aug 24, 2003, 11:25 PM
Thread Re: [Andy] Breaking Up a Line using PHP
JoFrRi 15653 Aug 25, 2003, 1:17 PM
Thread Re: [JoFrRi] Breaking Up a Line using PHP
Andy 15656 Aug 25, 2003, 11:38 PM
Thread Re: [Andy] Breaking Up a Line using PHP
Mark Badolato 15611 Aug 26, 2003, 12:32 AM
Thread Re: [Mark Badolato] Breaking Up a Line using PHP
Andy 15621 Aug 26, 2003, 12:34 AM
Thread Re: [Andy] Breaking Up a Line using PHP
Mark Badolato 15599 Aug 26, 2003, 12:36 AM
Thread Re: [Mark Badolato] Breaking Up a Line using PHP
Andy 15561 Aug 26, 2003, 12:42 AM
Thread Re: [Andy] Breaking Up a Line using PHP
Mark Badolato 15549 Aug 26, 2003, 8:13 AM
Post Re: [Mark Badolato] Breaking Up a Line using PHP
Andy 15477 Aug 26, 2003, 8:14 AM
Thread Re: [Mark Badolato] Breaking Up a Line using PHP
hennagaijin 15506 Aug 26, 2003, 8:41 AM
Thread Re: [hennagaijin] Breaking Up a Line using PHP
JoFrRi 15481 Aug 26, 2003, 3:01 PM
Thread Re: [JoFrRi] Breaking Up a Line using PHP
hennagaijin 15550 Aug 26, 2003, 3:10 PM
Thread Re: [hennagaijin] Breaking Up a Line using PHP
JoFrRi 15586 Aug 26, 2003, 3:36 PM
Thread Re: [JoFrRi] Breaking Up a Line using PHP
hennagaijin 15623 Aug 27, 2003, 11:12 AM
Thread Re: [hennagaijin] Breaking Up a Line using PHP
Andy 15595 Aug 27, 2003, 11:19 AM
Post Re: [Andy] Breaking Up a Line using PHP
JoFrRi 15453 Aug 27, 2003, 6:17 PM
Post Re: [Andy] Breaking Up a Line using PHP
JoFrRi 15568 Aug 25, 2003, 3:22 PM