public static function ellipsizeRight($string, $max, $ellipses = '...') {
		$string = trim($string);
		
		// don't ellipsize if the string is short enough
		if (strlen($string) <= $max) {
			return $string;
		}
		
		// chop at max length
		$string = substr($string, 0, $max);
		
		$chop = strrpos($string, ' ');
		if ($chop !== false)
			$string = substr($string, 0, $chop);
		
		$string = self::removeTrailingPunctuation($string);
		$string .= $ellipses;
		
		return $string;
	}
public static function ellipsizeRight($string, $max, $ellipses = '...') {
		$string = trim($string);
		
		// don't ellipsize if the string is short enough
		if (strlen($string) <= $max) {
			return $string;
		}
		
		// chop at max length
		$string = substr($string, 0, $max);
		
		$chop = strrpos($string, ' ');
		if ($chop !== false)
			$string = substr($string, 0, $chop);
		
		$string = self::removeTrailingPunctuation($string);
		$string .= $ellipses;
		
		return $string;
	}
public static function ellipsizeRight ( $ string , $ max , $ ellipses = '...' ) { $ string = trim ( $ string ) ; // don't ellipsize if the string is short enough if ( strlen ( $ string ) <= $ max ) { return $ string ; } // chop at max length $ string = substr ( $ string , 0 , $ max ) ; $ chop = strrpos ( $ string , ' ' ) ; if ( $ chop !== false ) $ string = substr ( $ string , 0 , $ chop ) ; $ string = self :: removeTrailingPunctuation ( $ string ) ; $ string .= $ ellipses ; return $ string ; }
Adds a ellipses to the right of a string and trims down the size

@param string $string
@param int $max
@param string $ellipses [default='...']
@return string
Adds a ellipses to the right of a string and trims down the size