Page 1 of 1

Extracting from string

Posted: Fri Apr 16, 2010 11:51 am
by yamyamuk
Hi I'm quite a newbie to PHP so just wondering if you could lend a hand. Sorry if this is is in the wrong place as well.

But anyway,

I have a string:

"variable1:variable2:variable3"

I am just wondering how I could split this up and extract each variable from this?

Many thanks in advance!

Re: Extracting from string

Posted: Fri Apr 16, 2010 11:55 am
by AbraCadaver

Code: Select all

explode()

Re: Extracting from string

Posted: Fri Apr 16, 2010 12:02 pm
by pickle
list() could also be useful.