• Модуль: socialnetwork
  • Путь к файлу: ~/bitrix/modules/socialnetwork/classes/general/functions.php
  • Класс: CSocNetTextParser
  • Вызов: CSocNetTextParser::html_cut
function html_cut($html, $size)
{
	$symbols = strip_tags($html);
	$symbols_len = mb_strlen($symbols);

	if($symbols_len < mb_strlen($html))
	{
		$strip_text = $this->strip_words($html, $size);

		if($symbols_len > $size)
			$strip_text = $strip_text."...";

		$final_text = $this->closetags($strip_text);
	}
	else
		$final_text = mb_substr($html, 0, $size);

	return $final_text;
}