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 21316 Aug 23, 2003, 6:03 PM
Thread Re: [JoFrRi] Breaking Up a Line using PHP
Mark Badolato 20837 Aug 23, 2003, 10:59 PM
Thread Re: [Mark Badolato] Breaking Up a Line using PHP
Andy 20835 Aug 24, 2003, 1:36 AM
Thread Re: [Andy] Breaking Up a Line using PHP
Mark Badolato 20895 Aug 24, 2003, 10:06 AM
Thread Re: [Mark Badolato] Breaking Up a Line using PHP
Andy 20994 Aug 24, 2003, 11:25 PM
Thread Re: [Andy] Breaking Up a Line using PHP
JoFrRi 20952 Aug 25, 2003, 1:17 PM
Thread Re: [JoFrRi] Breaking Up a Line using PHP
Andy 20860 Aug 25, 2003, 11:38 PM
Thread Re: [Andy] Breaking Up a Line using PHP
Mark Badolato 20811 Aug 26, 2003, 12:32 AM
Thread Re: [Mark Badolato] Breaking Up a Line using PHP
Andy 20824 Aug 26, 2003, 12:34 AM
Thread Re: [Andy] Breaking Up a Line using PHP
Mark Badolato 20813 Aug 26, 2003, 12:36 AM
Thread Re: [Mark Badolato] Breaking Up a Line using PHP
Andy 20760 Aug 26, 2003, 12:42 AM
Thread Re: [Andy] Breaking Up a Line using PHP
Mark Badolato 20835 Aug 26, 2003, 8:13 AM
Post Re: [Mark Badolato] Breaking Up a Line using PHP
Andy 20675 Aug 26, 2003, 8:14 AM
Thread Re: [Mark Badolato] Breaking Up a Line using PHP
hennagaijin 20723 Aug 26, 2003, 8:41 AM
Thread Re: [hennagaijin] Breaking Up a Line using PHP
JoFrRi 20679 Aug 26, 2003, 3:01 PM
Thread Re: [JoFrRi] Breaking Up a Line using PHP
hennagaijin 20761 Aug 26, 2003, 3:10 PM
Thread Re: [hennagaijin] Breaking Up a Line using PHP
JoFrRi 20793 Aug 26, 2003, 3:36 PM
Thread Re: [JoFrRi] Breaking Up a Line using PHP
hennagaijin 20900 Aug 27, 2003, 11:12 AM
Thread Re: [hennagaijin] Breaking Up a Line using PHP
Andy 20801 Aug 27, 2003, 11:19 AM
Post Re: [Andy] Breaking Up a Line using PHP
JoFrRi 20650 Aug 27, 2003, 6:17 PM
Post Re: [Andy] Breaking Up a Line using PHP
JoFrRi 20762 Aug 25, 2003, 3:22 PM