How to get first day of current month in php? [duplicate]

date('01-m-Y') should do it ;)


date('d-m-Y', strtotime(date('Y-m-1')));

$firstDayUTS = mktime (0, 0, 0, date("m"), 1, date("Y"));
$lastDayUTS = mktime (0, 0, 0, date("m"), date('t'), date("Y"));

$firstDay = date("d-m-Y", $firstDayUTS);
$lastDay = date("d-m-Y", $lastDayUTS);

How about :

date('1-m-Y',strtotime('this month'));