KiyoshiSaundo
4/3/2017 - 11:47 AM

php yeartext

php yeartext

<?
function YearTextArg($year, $words = array('год', 'года', 'лет')) {
	$m = substr($year,-1,1);
	$l = substr($year,-2,2);
	return $year. ' ' .((($m==1)&&($l!=11))?$words[0]:((($m==2)&&($l!=12)||($m==3)&&($l!=13)||($m==4)&&($l!=14))?$words[1]:$words[2]));
}