PHP first day and last day of current month / día inicial y final del mes actual

To get the first day and last day of current month in PHP:
Para obtener el primero y último día del mes actual en PHP:

      $dfechaini=date("Y-m-d", mktime(0, 0, 0, date("m"), 1));
      $dfechafin=date("Y-m-t", mktime(0, 0, 0, date("m"), 1));

The trick is the first parameter in date "Y-m-d" first day "Y-m-t" last day plus mktime
El truco es el primer parámetro en date "Y-m-d" primer día "Y-m-t" último día más mktime


Comentarios

Entradas populares de este blog

Todo listo para su nuevo iPhone (Cómo eliminar este mensaje)

TuneUp Utilities 2012

PHPWord in hosting with no terminal no composer / PHPWord en servidor sin terminal sin composer