I have been writing code to show a month, according to the day of the current month.
For example:
If we are between the 1st and the 10th of the actual month, I want to display the actual month. If we are after the 10th of the actual month, I want to display the next month.
So, if we are the March, 1st, I want 'March' to display.
But if we were the March, 22, I want 'April' to display.
I wanted the months displaying in Spanish. I've already done this by the following code.
Code:
function date_es($format = 'F', $time = null){
if(empty($time)) $time = time();
$date = date($format, $time);
$mois_en = array("January","February","March","April","May","June","July","August","September","October","November","December");
$mois_es = array("Enero","Febrero","Marzo","Abril","Mayo","Junio","Julio","Agosto","Septiembre","Octubre","Noviembre","Diciembre");
$date = str_replace($mois_en, $mois_es, $date);
return $date;
}
However, I do not know how to include the conditional statements to this code ?
Cheers for any help.