function strim($string, $width = 0, $trimmarker = null, $is_html = true, $is_remove_line_feed = false) { if (!$width) { return $string; } if (is_null($trimmarker)) { $trimmarker = '...'; } if ($is_remove_line_feed) { $string = str_replace(array("\r", "\n"), '', $string); } $original_width = mb_strlen($string); if ($is_html) { $string = Site_Util::html_entity_decode($string); } $string = mb_strimwidth($string, 0, $width, $trimmarker); if ($is_html) { $string = Security::htmlentities($string); } return $string; }