If I have a form that submits date in the following format:
YYYY-MM-DD (2008-06-12)
How can I strip month and date to keep date only?
You can explode on that field coming in from the form:
<?php $date = '2008-06-12'; $newdate = explode('-', $date); echo '<pre>'.print_r($newdate,true).'</pre>'; echo $newdate[0]."<br />"; echo $newdate[1]."<br />"; echo $newdate[2]."<br />"; ?>
list($year, $month, $day) = explode('-', $date); echo $day;