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')) { }
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