Page 1 of 1

Split Date into 3 variables

Posted: Sat Aug 30, 2014 10:47 am
by donny
hello,

i have a form that selects the date. it posts data as 03/05/2014 in 1 variable.. can someone tell me how i can implode it so that i can split the month day year

$date ="03/05/2014";

$date_month = $date['1'];
$date_day = $date['2'];
$date_year = $date['3'];


something like that i am guessing..

Re: Split Date into 3 variables

Posted: Sat Aug 30, 2014 11:53 am
by donny
explode worked fine.
thank you

Re: Split Date into 3 variables

Posted: Sat Aug 30, 2014 12:06 pm
by Celauran
Depending on why you're doing this, it may be better to just instantiate a DateTime object.