Add zero before any number or create the specific no of digit before adding zero

$value = 4;
str_pad($value, 8, ‘0’, STR_PAD_LEFT);

output :
00000004

Advertisements