Вход Регистрация
Файл: users/diary/inc/functions.php
Строк: 33
<?
function text_cutter($text$maxchar 50 )
{
$maxwords=10;
$sep=' ';
$sep2='...';
$words = @split($sep,$text);
$char iconv_strlen($text,'utf-8');
if (
count($words) > $maxwords)
{
$text join($separray_slice($words0$maxwords));
}
if ( 
$char $maxchar )
{
$text iconv_substr$text0$maxchar'utf-8' );
}
return 
$text;
}


function 
output_title($str)
{
return 
stripslashes(stripcslashes(htmlspecialchars($str)));
}

function 
sklon_text($int$expressions)
{
if (
count($expressions)<3)$expressions[2]=$expressions[1];
$count=$int%100;
if(
$count>=&& $count<=20)$result=2;
else 
$count=$count%10;
if(
$count==1)$result=0;
elseif(
$count>=&& $count<=4)$result=1;
else 
$result=2;
return 
$int.' '.$expressions[$result];
}
?>
Онлайн: 0
Реклама