Created
January 12, 2016 08:30
-
-
Save GiovanniK/426de8e1f307e7335ba8 to your computer and use it in GitHub Desktop.
24 uur, 15 min interval - PHP
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 | |
for($i = 0; $i <= 23; $i++) { | |
// If hour is lower than 10, append a 0 | |
if($i < 10) { | |
$append = 0; | |
} else { | |
$append = ''; | |
} | |
// Echo hour + minute | |
$minutes = 0; | |
for($i2 = 1; $i2 <= 4; $i2++) { | |
$minutes = ($i2 * 15) - 15; | |
$minutes2 = ($minutes > 0) ? $minutes : $minutes . '0'; | |
echo $append . $i . ':' . $minutes2 . '<br>'; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment