@kymkk;
<?php
function time_diff_val($old_time, $new_time, $is_float = false) {
$_old_time = strtotime($old_time);
$_new_time = strtotime($new_time);
$_diff = ($_new_time - $_old_time);
unset($old_time, $new_time, $_old_time, $_new_time);
return ($_diff <= 0) ? (int) 0 : (($_diff <= (24 * 60 * 60)) ? (int) 1 : (($is_float) ? ($_diff / (24 * 60 * 60)) : ceil($_diff / (24 * 60 * 60))));
}
print_r(
array(
time_diff_val(
"10.11.2013 00:00",
"10.12.2014 23:59"
),
time_diff_val(
"10.11.2013 00:00",
"10.12.2014 23:59",
true
)
)
);
/*
GERİYE DÖNEN DEĞER =>
Array
(
[0] => 396
[1] => 395.99930555556
)
*/