Код не мой, один из вариантов с просторов сети:
// код
function chti($string, $ch1, $ch2, $ch3){
$ff=Array('0','1','2','3','4','5','6','7','8','9');
if(substr($string,-2, 1)==1 AND strlen($string)>1) $ry=array("0 $ch3","1 $ch3","2 $ch3","3 $ch3" ,"4 $ch3","5 $ch3","6 $ch3","7 $ch3","8 $ch3","9 $ch3");
else $ry=array("0 $ch3","1 $ch1","2 $ch2","3 $ch2","4 $ch2","5 $ch3"," 6 $ch3","7 $ch3","8 $ch3"," 9 $ch3");
$string1=substr($string,0,-1).str_replace($ff, $ry, substr($string,-1,1));
return $string1;
}
// использование
echo chti(21,'минута','минуты','минут');
Самое крутое:
Моделей в корзине: <?=$arResult["COUNT_FITTING"];?>