ch1326 Posted April 27, 2009 Share Posted April 27, 2009 Hi everyone , I am having problem with date function. I would like to display year, month, date seperately with my $dt variable but seem everything is not correct. Please help !!!!! Thank u <?php $dt = date("y/m/d"); echo $dt(y); echo $dt(m); echo $dt(d); ?> Quote Link to comment https://forums.phpfreaks.com/topic/155803-solved-date-function-help/ Share on other sites More sharing options...
FezEvils Posted April 27, 2009 Share Posted April 27, 2009 <?php $dtx = date("y/m/d"); $dt = explode ("/",$dtx); echo $dt[2]; echo $dt[1]; echo $dt[0]; ?> there a many ways to assign value to a variable , like $month = date ("m") Quote Link to comment https://forums.phpfreaks.com/topic/155803-solved-date-function-help/#findComment-820133 Share on other sites More sharing options...
avvllvva Posted April 27, 2009 Share Posted April 27, 2009 $dt is string type variable. Try this <?php echo date("y"); echo date("m"); echo date("d"); ?> Quote Link to comment https://forums.phpfreaks.com/topic/155803-solved-date-function-help/#findComment-820134 Share on other sites More sharing options...
ch1326 Posted April 27, 2009 Author Share Posted April 27, 2009 Many thanks for all of u !!!! PROBLEM SOLVED !!!! THANK AGAIN Quote Link to comment https://forums.phpfreaks.com/topic/155803-solved-date-function-help/#findComment-820139 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.