Explode function question

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
vodius
Forum Newbie
Posts: 6
Joined: Sun Apr 06, 2008 4:21 pm

Explode function question

Post by vodius »

Hi all,
I'm trying to explode block of text to run some function on it, but I have to explode it by ' ' (space) OR by '<br>' (line break)
I guess there is no way to specify OR in the explode function itself, so it would have to be multystep process.
Please help,
Thanks

Example of text to be exploded by ' ' and by '<br>':
Hello world
how are you

Should return array['Hello','world','how','are','you']

Thanks
User avatar
Christopher
Site Administrator
Posts: 13596
Joined: Wed Aug 25, 2004 7:54 pm
Location: New York, NY, US

Re: Explode function question

Post by Christopher »

Show us your code. There are several functions that split strings.
(#10850)
vodius
Forum Newbie
Posts: 6
Joined: Sun Apr 06, 2008 4:21 pm

Re: Explode function question

Post by vodius »

Thanks for the reply, I actually figured it out, I replaced "<br />" with " <br /> " and then ran explode for " "...
Thanks for reply though.
Post Reply