Is there any native PHP function which would allow me to do this?
$number = functionName(1, 9999); // $number == 0001
$number = functionName(10, 99); // $number == 10
$number = functionName(10, 999); // $number == 010
If there isn't native function, is there any user-based function?