“Obtenga el mes pasado usando PHP” Código de respuesta

Obtenga el mes pasado PHP

$currentMonth = date('M');// if number, then date('m');
//Last month
$lastMonth = Date("F", strtotime("first day of previous month");
$nextMonth = Date("F", strtotime("first day of next month");
CuteKittyCat

PHP Último día del mes

$a_date = "2009-11-23";
echo date("Y-m-t", strtotime($a_date));
Evil Echidna

Obtenga el mes pasado usando PHP

//Last month
$lastMonth = Date("F", strtotime("first day of previous month");
$nextMonth = Date("F", strtotime("first day of next month");
Ankur

Respuestas similares a “Obtenga el mes pasado usando PHP”

Preguntas similares a “Obtenga el mes pasado usando PHP”

Más respuestas relacionadas con “Obtenga el mes pasado usando PHP” en PHP

Explore las respuestas de código populares por idioma

Explorar otros lenguajes de código