I have 2 functions for checking if today is the first day of the month. Does one of these have an advantage over the other, ie accuracy?
if(date('j', $timestamp) === '1') { }
if(date('Y-m-d') == date('Y-m-01')) { }
The first one does less checking I would use that.
You also don't need the timestamp argument if you want to check now / today
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With