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); ?> 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") 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"); ?> 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 Link to comment https://forums.phpfreaks.com/topic/155803-solved-date-function-help/#findComment-820139 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.