how to get past date in php
<?php // get past 15 days date in php $d1 = date ( 'Y-m-d' , strtotime ( '-15 days' )); date ( 'Y-m-d' , strtotime ( '-15 months' )); // $d1 = date ( 'Y-m-d' , strtotime ( ' -20 year ' )); // next 15 days date in php $d1=date('Y-m-d', strtotime('15 days')); $date = "2012-10-10"; $newdate = strtotime ( ' -10 days ' , strtotime ( $date ) ) ; $newdate = date ( 'Y-m-d' , $newdate ); echo $newdate; ?>