note 98921 modified in function.date by danbrown

From: Date: Thu, 15 Jul 2010 17:21:43 +0000
Subject: note 98921 modified in function.date by danbrown
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-170892@lists.php.net to get a copy of this message
This is a simple function I did to print the names of the month in spanish. the variable $dateMes is the month in mm format just as you take it from a Mysql date field. it takes the int value of the mm month and then prints the position of an array with the names of month. <?php function Mes($dateMes) { $mes=Array( "", "enero", "febrero", "marzo", "abril", "mayo", "junio", "julio", "agosto", "septiembre", "octubre", "noviembre", "diciembre"); return $mes[intval($dateMes)]; } ?> --was-- This is a simple function I did to print the names of the month in spanish. the variable $dateMes is the month in mm format just as you take it from a Mysql date field. it takes the int value of the mm month and then prints the position of an array with the names of month. function Mes($dateMes) { $mes=Array( "", "enero", "febrero", "marzo", "abril", "mayo", "junio", "julio", "agosto", "septiembre", "octubre", "noviembre", "diciembre"); return $mes[intval($dateMes)]; } http://php.net/manual/en/function.date.php

« previous php.notes (#170892) next »