Lines Matching refs:length
88 * Truncates a string to a certain length at the most sensible point.
92 * If the string is already shorter than $length, it is returned unchanged.
95 * @param int $length the maximum length the string should be truncated to
98 public static function iTrunc($string, $length)
100 if (strlen($string) <= $length) {
105 if ($pos >= $length - 4) {
106 $string = substr($string, 0, $length - 4);
109 if ($pos >= $length * 0.4) {
114 if ($pos >= $length - 4) {
115 $string = substr($string, 0, $length - 4);
118 if ($pos >= $length * 0.4) {
122 return substr($string, 0, $length - 4)." ...";