Gossamer Forum
Home : General : Internet Technologies :

Breaking Up a Line using PHP (Part 2)

Quote Reply
Breaking Up a Line using PHP (Part 2)
When I was breaking up my lines using
Code:
for ($index=0; $index < count($ot_load); $index++) {
$text = explode(":", chop($ot_load[$index]));


I failed to recognize the huge problem of more colons. So I'm back asking if there is a way to explode only the first 3 colons.

My line example:

Code:
Book:Chap:Verse: Text that would make: up my verse.


Results in:

Book | Chap | Verse | Text that would make

Where as I need the result to be:

Book | Chap | Verse | Text that would make: up my verse.
Quote Reply
Re: [JoFrRi] Breaking Up a Line using PHP (Part 2) In reply to
Please read the manual: http://php.net/explode

Adrian
Quote Reply
Re: [brewt] Breaking Up a Line using PHP (Part 2) In reply to
The first time I read that through, I didn't understand it, however I tried some stuff and sure enough, I found the answer I was looking for. Thanks for the advice. Smile