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>" ?> 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>"; ?> 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 =) 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 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
Archived
This topic is now archived and is closed to further replies.