
Jeffrey P. answered 07/19/23
Tutor
4.9
(81)
You need help with PHP? Send me a message.
You can use str_pad to do this.
$number = "1234567";
$number = str_pad($number, 8, "0", STR_PAD_LEFT);
echo $number;
As long as your number is less than 8 digits, it will append 0s to it.