prepend 0 to number php
snippet in php

prepend 0 to number php

user8962

str_pad($month, 2, '0', STR_PAD_LEFT); 

php format int to 9 digits with preceding zeroes

user8698

str_pad($input, 9, "0", STR_PAD_LEFT);

php pad leading zeros

user7036

str_pad($value, 8, '0', STR_PAD_LEFT);