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 ))