Search the Community
Showing results for tags 'date function'.
-
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!!
-
Hello, I can't achieve what I am looking to do here: <html> <head> <title>PHP Weekend Challenge</title> </head> <body> <?php \\*if month = december and day = 23rd and time=19:00-23:59 echo "Good Evening, tomorrow is Christmas Eve!" or if month = december and day = 24th and time=19:00-23:59 echo "Good Evening, tomorrow is Christmas Day!" else echo "It's not Christmas so too bad - it's just another 7 day working week!"*\\ ?> </body> </html> I'm a newbie so please assume I know nothing about PHP and provide as much explanation as you can for the solutions you give. I have read around on different websites and I find it exceptionally difficult to understand them because of my dyslexia and dyscalculia. Please advise :-) Thanks and Kind Regards, Beanie
- 4 replies
-
- if statements
- date function
-
(and 3 more)
Tagged with: