Copy the code as follows: This time it will appear: 001 If you want to increase the number of digits can be increased by 1000, and then 3 also increased. Example: If I want to make up the "4 0" line No. 03 It will be like this. Copy the code as follows: In fact, to show a total number of numbers, the $sourcenumber+1 after the number of 0, the last number directly changed to show several numbers. Better method: String Str_pad (string $input, int $pad _length [, String $pad _string [, int $pad _type]]) copy Code code
1. PHISON-UP10 Production tools v1.78.00 PHP Digital left auto-fill 0
Introduction: PHISON-UP10 Production tool V1.78.00:PHISON-UP10 production tool v1.78.00 PHP digital left auto 0: Copy code code as follows: <?php $sourceNumber = "1"; $newNumber = substr (Strval ($sourceNumber +1000), 1, 3); echo "$newNumber";?> will appear at this time: 001 If you want to increase the number of digits, you can add 1000.
2. PHP digital left auto-complement 0_php tutorial
Summary: The left side of the PHP number is automatically 0. Copy the code as follows: PHP $sourceNumber = "1"; $newNumber =substr (Strval ($sourceNumber +1000), 1, 3); echo "$newNumber";? This time it will appear: 001 If you want to increase the number of digits, you can
3. PHP Digital left auto-fill 0
Summary: The left side of the PHP number is automatically 0. Copy the code as follows: PHP $sourceNumber = "1"; $newNumber =substr (Strval ($sourceNumber +1000), 1, 3); echo "$newNumber";? This time it will appear: 001 If you want to increase the number of digits, you can
4. PHP several digits to the left auto-complement 0
Introduction: PHP Several digital left auto-complement 0
5. PHP digital left auto-complement 0_php tips
Introduction: For example: Employee's work number X001 although the MySQL itself field is set to the Zerofill attribute, the portion of the shortfall is added to 0, but this function can only be used on fields with numbers. So when necessary, I had to rely on PHP to do it.
"Related question and answer recommendation":