10-year intermittent problem:
Invoices displayed on my website are assigned a unique 7-digit order number generated by PHP's date function
$invoice_number = date("njis"); // creates, for example, invoice number "7223060"
Roughly 10% of the time, no order number is displayed!
That means, for whatever reason, from time to time, php's date function decides NOT to create a date.
Over the past 10 years, I have been on different servers, at different hosts, with, obviously, different PHP versions.
Is this one of those things, like, a "well-known-issue" about PHP's date function? Or what?
I have even had to code built-in "backup-plan fail-safes" like: $invoice_number = date("njis");
if (strlen($invoice_number) < 4) {
$invoice_number = date("njis").rand(11111,99999);
// mail(webmaster notice);
}
What are your thoughts?
Thank you!!