How does php generate a serial number of + 1 per day by date?

Source: Internet
Author: User
How does php generate a serial number of + 1 per day by date? How does php generate a serial number of + 1 per day by date? for example, the serial number of + 1 per day is January 1, 2014 on January 1, 14001 & nbsp; the value of No. 2 is 14002 & nbsp; 3 & nbsp; the serial number is February 1 from 003 to March 31, 14032. Sharing: How does php generate a serial number of + 1 per day by date?
How does php generate a serial number of + 1 per day by date? for example, on April 9, January 1, 2014, 14001, 2, 14002, 3, and 003
February 1 by 14032

Share: More


------ Solution --------------------
$ No = sprintf ('% s % 03d', date ('Y'), date ('Z '));
------ Solution --------------------
$ Date = time ();
$ Year = date ('Y', $ date );
$ Day = date ('Z', $ date );
$ Day = str_pad ($ day, 3, 0, STR_PAD_LEFT );
Echo $ year. $ day;
------ Solution --------------------
$ Day = date ('Z', mktime (0, 0, 0, $ month, $ day, $ year ))

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.