jacko_162 Posted March 13, 2010 Share Posted March 13, 2010 when i echo my results (months) i use; $month this displays the month in full how can i limit this to show; "Dec" instead of "December" without changing my database this is the full echo code im using; // make sure we have a valid product if($id != "" && $id != null) echo "<td width='120' height='115' background='img/calendars/blank_calendar.png'><a href='testresults.php'><div class='cal_text' align='center'><strong><img src='img/spacer.png' width='1' height='6'><br> $id<br>$month</strong></div></a>"; it displays the date as: 16 December i want it to display; 16 Dec many thanks Link to comment https://forums.phpfreaks.com/topic/195154-reducing-echo-value/ Share on other sites More sharing options...
Tazerenix Posted March 14, 2010 Share Posted March 14, 2010 how are you entering it into the database Link to comment https://forums.phpfreaks.com/topic/195154-reducing-echo-value/#findComment-1025755 Share on other sites More sharing options...
jacko_162 Posted March 14, 2010 Author Share Posted March 14, 2010 the month gets entered as a full month name "December" as i call it on another page. its done automatically in a hidden txt box in a user submitted form. Link to comment https://forums.phpfreaks.com/topic/195154-reducing-echo-value/#findComment-1025761 Share on other sites More sharing options...
teamatomic Posted March 14, 2010 Share Posted March 14, 2010 $month=substr($month,0,3); HTH Teamatomic Link to comment https://forums.phpfreaks.com/topic/195154-reducing-echo-value/#findComment-1025773 Share on other sites More sharing options...
trq Posted March 14, 2010 Share Posted March 14, 2010 echo date('M', strtotime($month)); Link to comment https://forums.phpfreaks.com/topic/195154-reducing-echo-value/#findComment-1025776 Share on other sites More sharing options...
jacko_162 Posted March 14, 2010 Author Share Posted March 14, 2010 $month=substr($month,0,3); HTH Teamatomic worked a treat Link to comment https://forums.phpfreaks.com/topic/195154-reducing-echo-value/#findComment-1025778 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.