Albatross Posted July 26, 2007 Share Posted July 26, 2007 Heya once again! This time is's an easy one and I read it on this site just last week but shucks if I can't find it when I need it... I'm trying to get the suffix to the day of the month... <?php echo date("D"); ?> This give me the number of the day, but not the suffix, 'th'. Today reads 26 and I'm trying to get it to read 26th without using code like this: <?php echo date("D"); ?><sup>th</sup> Link to comment https://forums.phpfreaks.com/topic/61918-solved-adding-suffixes-to-dates/ Share on other sites More sharing options...
yarnold Posted July 26, 2007 Share Posted July 26, 2007 <?php echo date("dS"); ?> Or, if you wanted it with sup.. <?php echo date("d").'<sup>'.date("S").'</sup>'; ?> Link to comment https://forums.phpfreaks.com/topic/61918-solved-adding-suffixes-to-dates/#findComment-308291 Share on other sites More sharing options...
effigy Posted July 26, 2007 Share Posted July 26, 2007 <?php echo date("dS"); ?> Link to comment https://forums.phpfreaks.com/topic/61918-solved-adding-suffixes-to-dates/#findComment-308292 Share on other sites More sharing options...
Albatross Posted July 26, 2007 Author Share Posted July 26, 2007 Caught it when my date showed 2627 when I used 'ds' and then Thuth when I used DS. Deductive logic kicked in at this point! Thank you all! Link to comment https://forums.phpfreaks.com/topic/61918-solved-adding-suffixes-to-dates/#findComment-308296 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.