String split

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
olivarra
Forum Newbie
Posts: 4
Joined: Thu Apr 24, 2008 4:05 pm

String split

Post by olivarra »

hi, i'm new in this language so i want to know if it's any function that splits a string making an array, like that:

$reg_date = '2008-02-24'; (imported from a Mysql database)
$array = Functionthatiwanttoknow($reg_date, "-");
$reg_year = $array[0];
$reg_month = $array[1];
$reg_day = $array[2];

Txs ^^

olivarra
User avatar
Oren
DevNet Resident
Posts: 1640
Joined: Fri Apr 07, 2006 5:13 am
Location: Israel

Re: String split

Post by Oren »

explode() is what you need. list() may be of interest as well.
olivarra
Forum Newbie
Posts: 4
Joined: Thu Apr 24, 2008 4:05 pm

Re: String split

Post by olivarra »

ok thank you very much ^^
olivarra
Post Reply