$hour_list = range(0,24);
foreach($hour_list as $key=>$val){
$hour_list[$key] = str_pad($val, 2, "0", STR_PAD_LEFT);
}
var_dump($hour_list); $hour_list = range(0,24);
foreach($hour_list as $key=>$val){
$hour_list[$key] = sprintf('%02d',$val);
}
var_dump($hour_list);