How to generate sequential numbers consisting of year, month, 5-digit sequence. with the digits reset when changing the month?
Example:
14 // ANO
11 // MÊS
00000 // SEQUÊNCIA QUE AO MUDAR O MÊS ZERA
Getting: 141100000
.. 141100001
.. 141100002
When you change the month: 141200000
.. 141200001
.. 141200002
These numbers are assigned to a work order and saved in the DB, of course they will be unique.
My function looks like this:
function generateNumber(){
return date('ym').'00000'; //141100000
}