This small php snippet will help you to find the difference between two given dates
function d_diff( $start , $end ) { $start_ts = strtotime ( $start ); $end_ts = strtotime ( $end ); $diff = $end_ts - $start_ts ; return round ( $diff / 86400); } echo d_diff( "10-3-2011" , "29-3-2012" ). ‘ days’; |
0 comments:
Post a Comment