PHP – Get Russian Pluralization

/**
 * Russian Pluralization
 *
 * @param $number
 * @return int
 */
function getPlural($number, $russianPluralization = true)
{
	if ($russianPluralization) {
		// Russian pluralization rules
		$typeOfPlural = (($number % 10 == 1) && ($number % 100 != 11))
			? 0
			: ((($number % 10 >= 2)
				&& ($number % 10 <= 4)
				&& (($number % 100 < 10)
					|| ($number % 100 >= 20)))
				? 1
				: 2
			);
	} else {
		// No rule for other languages
		$typeOfPlural = $number;
	}
	
	return $typeOfPlural;
}