topherbones icon

PHP Date Tricks

topherbones | PRO | 03/03/23 02:37:08 PM UTC | 0 ⭐ | 872 👁️ | Never ⏰ | []
PHP |

420 B

|

None

|

0 👍

/

0 👎

############################################################################################################
// Get the last day of current or set month
$aDate = "2009-11-23";
echo date("Y-m-t", strtotime($aDate));
 
t = number of days in a month, you want the year, to account for variations, such as a leap year.
############################################################################################################

Comments