2013-05-03 8 views

Odpowiedz

10
<?php 
$day=new DateTime('last day of this month'); 
echo $day->format('M jS'); 
?> 
6

spróbować tej

$day=date('Y-m-t'); // gives last day of current month 

LUB

$d = new DateTime('2013-05-03'); 
echo $d->format('Y-m-t'); 
1

Spróbuj

$date = new DateTime(); 
$lastDayOfMonth = $date->modify(
    sprintf('+%d days', $date->format('t') - $date->format('j')) 
); 
Powiązane problemy