Recommended 10 common left auto-complement 0 usage, welcome to download!

Source: Internet
Author: User
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":

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.