I have
str_pad()
echo str_pad($input, 2, "0", STR_PAD_LEFT);
sprintf()
echo sprintf("%02d", $input);