Created
April 22, 2015 15:03
-
-
Save saltun/d9d954c97a8a1b5ed943 to your computer and use it in GitHub Desktop.
PHP Rastgele Saat oluşturma
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 | |
/** | |
* Create random time [ PHP ] | |
* @author Savaş Can ALTUN <[email protected]> | |
*/ | |
function randomTime($first,$last){ | |
$number = rand($first,$last); | |
if($number<10){ | |
$result='0'.$number; | |
return $result; | |
}else{ | |
return $number; | |
} | |
} | |
echo randomTime(0,23).":".randomTime(0,59); // 14:28 - 22:23 - 12:10 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment