Extracting from string

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
yamyamuk
Forum Newbie
Posts: 1
Joined: Fri Apr 16, 2010 11:49 am

Extracting from string

Post 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!
User avatar
AbraCadaver
DevNet Master
Posts: 2572
Joined: Mon Feb 24, 2003 10:12 am
Location: The Republic of Texas
Contact:

Re: Extracting from string

Post by AbraCadaver »

Code: Select all

explode()
mysql_function(): WARNING: This extension is deprecated as of PHP 5.5.0, and will be removed in the future. Instead, the MySQLi or PDO_MySQLextension should be used. See also MySQL: choosing an API guide and related FAQ for more information.
User avatar
pickle
Briney Mod
Posts: 6445
Joined: Mon Jan 19, 2004 6:11 pm
Location: 53.01N x 112.48W
Contact:

Re: Extracting from string

Post by pickle »

list() could also be useful.
Real programmers don't comment their code. If it was hard to write, it should be hard to understand.
Post Reply