fork(1) download
  1. <?php
  2. $entrada = 23.25;
  3. $saida = 11.50;
  4.  
  5. print_r( intervalo( $entrada, $saida ) );
  6.  
  7. function intervalo( $entrada, $saida ) {
  8. $minutos = (int)($entrada * 60 - $saida * 60 );
  9. if( $minutos < 0 ) $minutos += 24 * 60;
  10. return $minutos / 60;
  11. }
  12.  
Success #stdin #stdout 0s 52488KB
stdin
Standard input is empty
stdout
11.75