How to offset a value with leading 0 or chr

//Offset string with some chr or number
//I use this script to sort out array in 001 to 100
//if not it will give an order 1,11,13-19 & 2,20-29 like that

$mynumbers = str_pad(10, 2, "0", STR_PAD_LEFT);
// result 0010

$mynumbers = str_pad(10, 5, "0", STR_PAD_LEFT);
// result 0000010

??