Date months translation function

Simple example function how to translate months for own language.

Create function: month

<?php
 function month($month_nr)
 {
	switch($month_nr)
	{
		default:
		$translate="January";
		break;
		case'2':
		$translate="February";
		break;		
		case'3':
		$translate="March";
		break;			
		case'4':
		$translate="April";
		break;	
		case'5':
		$translate="May";
		break;	
		case'6':
		$translate="June";
		break;
		case'7':
		$translate="July";
		break;
		case'8':
		$translate="August";
		break;
		case'9':
		$translate="September";
		break;
		case'10':
		$translate="October";
		break;
		case'11':
		$translate="November";
		break;
		case'12':
		$translate="December";
		break;		
	}
	return $translate;
 }
?>

Now we use date (n format) and month function

<?php echo month(date("n")); ?>
output: August

Now you can translate months and use your own language. More information about date formats - Date formats list