Check 2 values after. (Score)

1

I'm developing a code where I have to calculate daily parking. If the user selects for example:

  

From: 11/5/2015 3:00 PM until 11/6/2015 3:00 PM

The value to return is 1 , that is, 1 daily. If you select:

  

From: 11/5/2015 3:00 PM until 11/6/2015 4:00 PM

The value to be returned will be 1.xxxxx And so on. What I need to know is if there is a value after the. (dot) then it means that it is one more daily than the left value (which in the example case is 1).

The code I currently have is

<?php
$entrada = strtotime('2015-11-05 10:00');
$saida = strtotime('2015-11-10 11:00');

$diaria = ($saida-$entrada) / (60*60*24);

echo $diaria;
?>

It does the right calculation, I just need to know if it has any value after. to count as + 1 daily.

    
asked by anonymous 05.11.2015 / 17:52

1 answer

3

Try using the ceil feature, I think it will help you out.

Embrace

    
05.11.2015 / 17:57