I thought this was a great question so I wanted to throw my hat into the ring. I like the solutions proffered but wanted to do it without deliberate for/foreach loops. So, here's three solutions (subtle variations):
// using array_map() with a designed callback function
$array = array_map(custom_sprintf, range(0,59));
//print_r($array);
function custom_sprintf($s) {
return sprintf("%02d", $s);
}
// using array_walk() with an inline create_function() call
$array = range(0,59);
array_walk($array, create_function('&$v', '$v = sprintf("%02d", $v);'));
// print_r($array);
// using array_map() and create_function() for a little code golf magic
$array = array_map(create_function('&$v', 'return sprintf("%02d", $v);'), range(0,59));