PHP 8.4.24 Released!

Voting

: min(nine, zero)?
(Example: nine)

The Note You're Voting On

me at phpscott dot com
14 years ago
So, I needed a quick and dirty way to create a dropdown select for hours, minutes and seconds using 2 digit formatting, and to create those arrays of data, I combined range with array merge..

<?php
$prepend = array('00','01','02','03','04','05','06','07','08','09');
$hours     = array_merge($prepend,range(10, 23));
$minutes     = array_merge($prepend,range(10, 59));
$seconds     = $minutes;
?>

Super simple.

<< Back to user notes page

To Top