Forum Moderators: coopster

Message Too Old, No Replies

Splitting date mmddyyyy

         

nfs2

12:05 am on Apr 7, 2006 (gmt 0)

10+ Year Member



Im trying to split a date formatted in mmddyyyy into 3 usable variables $month $day and $year

So a function like

function splitdate($date, $var){

//do something here :P

}

and to get the day would be like $day = splitdate(12051978, 'day');

Anyone have any idea how to do it?

jatar_k

12:22 am on Apr 7, 2006 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



take a look at substr [php.net]

nfs2

12:43 am on Apr 7, 2006 (gmt 0)

10+ Year Member



Thats perfect! Thank you :)