anth0ny Posted January 7, 2009 Share Posted January 7, 2009 How would i write this so that it works? <php echo "<li class=\"med\">date('d/m/Y',strtotime($departureDate));</li>" ?> Quote Link to comment https://forums.phpfreaks.com/topic/139856-solved-date-function-inside-an-echo/ Share on other sites More sharing options...
cytech Posted January 7, 2009 Share Posted January 7, 2009 Give this a go <php echo "<li class=\"med\">".date('d/m/Y',strtotime($departureDate))."</li>"; ?> Quote Link to comment https://forums.phpfreaks.com/topic/139856-solved-date-function-inside-an-echo/#findComment-731659 Share on other sites More sharing options...
premiso Posted January 7, 2009 Share Posted January 7, 2009 <?php echo "<li class=\"med\">".date('d/m/Y',strtotime($departureDate))."</li>"; ?> You forgot the initial ? between < and php =) Quote Link to comment https://forums.phpfreaks.com/topic/139856-solved-date-function-inside-an-echo/#findComment-731660 Share on other sites More sharing options...
anth0ny Posted January 7, 2009 Author Share Posted January 7, 2009 thanks guys nice one Quote Link to comment https://forums.phpfreaks.com/topic/139856-solved-date-function-inside-an-echo/#findComment-731665 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.