Ver Mensaje Individual
  #2 (permalink)  
Antiguo 02/12/2015, 09:02
Avatar de hhs
hhs
Colaborador
 
Fecha de Ingreso: junio-2013
Ubicación: México
Mensajes: 2.995
Antigüedad: 10 años, 10 meses
Puntos: 379
Respuesta: PHP Cambiar fecha cadena a date

Es muy sencillo, utiliza la extensión intl: http://php.net/manual/es/book.intl.php te dejo un ejemplo como base, utilizando la fecha que tienes en tu mensaje.
Código PHP:
Ver original
  1. $fmt = new IntlDateFormatter(
  2.     "es_ES" ,
  3.     IntlDateFormatter::FULL,
  4.     IntlDateFormatter::FULL,
  5.     null,
  6.     IntlDateFormatter::GREGORIAN,
  7.     "MMMM 'de' yyyy"
  8. );
  9.  
  10. $date = new DateTime('2015-12-24');
  11.  
  12. echo utf8_decode($fmt->format($date)); //Imprime diciembre de 2015
__________________
Saludos
About me
Laraveles
A class should have only one reason to change.