Manish Garg 142 Questions 8 Answers 5 Best Answers 167 Points View Profile1 Manish Garg Asked: June 15, 2019In: PHPFormatting a number with leading zeros in PHP1Use sprintf:sprintf('%08d', 1234567);Alternatively you can also use str_pad: str_pad($value, 8, '0', STR_PAD_LEFT); ShareFacebookReportLeave an answerLeave an answerCancel reply Featured image Select file Browse