public static function truncateWords($str, $length, $trailing='...') {
		$words = explode(' ', $str);
		$cutwords = array_slice($words, 0, $length);

		return implode(' ', $cutwords).(count($words) > count($cutwords) ? $trailing:'');
	}