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 21389 Aug 23, 2003, 6:03 PM
Thread Re: [JoFrRi] Breaking Up a Line using PHP
Mark Badolato 20907 Aug 23, 2003, 10:59 PM
Thread Re: [Mark Badolato] Breaking Up a Line using PHP
Andy 20905 Aug 24, 2003, 1:36 AM
Thread Re: [Andy] Breaking Up a Line using PHP
Mark Badolato 20965 Aug 24, 2003, 10:06 AM
Thread Re: [Mark Badolato] Breaking Up a Line using PHP
Andy 21064 Aug 24, 2003, 11:25 PM
Thread Re: [Andy] Breaking Up a Line using PHP
JoFrRi 21022 Aug 25, 2003, 1:17 PM
Thread Re: [JoFrRi] Breaking Up a Line using PHP
Andy 20930 Aug 25, 2003, 11:38 PM
Thread Re: [Andy] Breaking Up a Line using PHP
Mark Badolato 20882 Aug 26, 2003, 12:32 AM
Thread Re: [Mark Badolato] Breaking Up a Line using PHP
Andy 20894 Aug 26, 2003, 12:34 AM
Thread Re: [Andy] Breaking Up a Line using PHP
Mark Badolato 20883 Aug 26, 2003, 12:36 AM
Thread Re: [Mark Badolato] Breaking Up a Line using PHP
Andy 20830 Aug 26, 2003, 12:42 AM
Thread Re: [Andy] Breaking Up a Line using PHP
Mark Badolato 20905 Aug 26, 2003, 8:13 AM
Post Re: [Mark Badolato] Breaking Up a Line using PHP
Andy 20745 Aug 26, 2003, 8:14 AM
Thread Re: [Mark Badolato] Breaking Up a Line using PHP
hennagaijin 20793 Aug 26, 2003, 8:41 AM
Thread Re: [hennagaijin] Breaking Up a Line using PHP
JoFrRi 20749 Aug 26, 2003, 3:01 PM
Thread Re: [JoFrRi] Breaking Up a Line using PHP
hennagaijin 20831 Aug 26, 2003, 3:10 PM
Thread Re: [hennagaijin] Breaking Up a Line using PHP
JoFrRi 20863 Aug 26, 2003, 3:36 PM
Thread Re: [JoFrRi] Breaking Up a Line using PHP
hennagaijin 20971 Aug 27, 2003, 11:12 AM
Thread Re: [hennagaijin] Breaking Up a Line using PHP
Andy 20871 Aug 27, 2003, 11:19 AM
Post Re: [Andy] Breaking Up a Line using PHP
JoFrRi 20720 Aug 27, 2003, 6:17 PM
Post Re: [Andy] Breaking Up a Line using PHP
JoFrRi 20832 Aug 25, 2003, 3:22 PM