Home >> Snippet List >> Snippet

Name
Convert Hours to Minutes
Description
Simple hours to minutes conversion code
PHP Snippet
<?PHP
 
FUNCTION h2m($hours) { 
            $t = EXPLODE(".", $hours); 
            $h = $t[0]; 
            IF (ISSET($t[1])) { 
                $m = $t[1]; 
            } ELSE { 
                $m = "00"; 
            } 
            $mm = ($h * 60)   $m; 
            RETURN $mm; 
    } 
?>