Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function daysTo($from, $to, $round=true)
- {
- $diff = $to-$from;
- $days = ($diff/86400)+1;
- return $round==true ? floor($days) : round($days,2);
- }
- //usage
- $from = strtotime($start_date); // tarikh mula
- $to = strtotime($end_date); //tarikh akhir
- echo daysTo($from, $to, false);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement