Archive for September 27th, 2009

Found this today which is really handy (and simple!) if you need a leading zero on your single digit numbers:
12345$months = range(1,12);
foreach($months as $month){
    echo sprintf("%02d", $month);
}
// Will output 01,02,03,04,05,06,07,08,09,10,11,12


top