Illustrating a new line as a delimiter?

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
ldexterldesign
Forum Newbie
Posts: 15
Joined: Fri Apr 17, 2009 6:14 am
Location: Bristol, UK

Illustrating a new line as a delimiter?

Post by ldexterldesign »

Hey people,

Space as a delimiter I'm down with:

Code: Select all

$var = 'Reading Birmingham London Brighton Leeds Liverpool Cambridge'
 
        $contents = explode([b]'  '[/b], $contents);
 
How would I represent the new lines as a delimiter? (I'm pulling the list in as a varible from another file via an include function you see:

Code: Select all

Reading
Birmingham
London
Brighton
Leeds
Liverpool
Cambridge
 
        $contents = explode([b]' ??? '[/b], $contents);
 
Thanks,
L
ldexterldesign
Forum Newbie
Posts: 15
Joined: Fri Apr 17, 2009 6:14 am
Location: Bristol, UK

Re: Illustrating a new line as a delimiter?

Post by ldexterldesign »

Looks like I just found the answer to my own question (eventually!): http://is.gd/ucRe
Post Reply