brown2005 Posted March 4, 2007 Share Posted March 4, 2007 I knew how to do this but I have totally forgot, i have $date = $array['date']; which is 2007-04-05 how do i turn into 05-04-2007 thanks Quote Link to comment Share on other sites More sharing options...
fert Posted March 4, 2007 Share Posted March 4, 2007 $temp=explode("-",$date); $date=$temp[2]."-".$temp[1]."-".$temp[0]; Quote Link to comment Share on other sites More sharing options...
JBS103 Posted March 5, 2007 Share Posted March 5, 2007 This is the exact same thing, but you have some flexibility in using the date function: <?php $date = "2007-04-05"; $temp = explode("-",$date); echo date("d-m-Y", mktime(0, 0, 0, $temp[1], $temp[2], $temp[0])); ?> What was previously posted is also legitimate and might be easier, but this will help you out if you ever want a different format. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.