Posted on January 22, 2014 by adminTo add zero before a number str_pad("12", 5, '0', STR_PAD_LEFT); result 00012