Created
June 19, 2014 10:26
-
-
Save azeemhassni/a1fc03b532b83a5c6020 to your computer and use it in GitHub Desktop.
Convert Minuts to Time String
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function timeToString($time) { | |
$t = $time / 60; | |
$t = number_format($t, 2); | |
// Result 1.5; | |
$__t = explode('.', $t); | |
$m = "0.".$__t[1]; | |
$m * 60; | |
$m = $m*60; | |
return $__t[0]." Hours ". round($m) ." Minuts"; | |
} | |
/** | |
* Usage | |
* | |
* **/ | |
echo timeToString(90); | |
// it will retrun 1 Hour 30 Minuts | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment