$text = "This is a long text that needs to be shortened."; $short_text = ilUtil::shortenText($text, 20); // "This is a long text..." $other_text = "This text is already short."; $also_short_text = ilUtil::shortenText($other_text, 20); // "This text is already short."In the first example, the original text is longer than 20 characters, so the function returns a shortened version with an ellipsis at the end. In the second example, the original text is already shorter than 20 characters, so the function returns the original text without making any changes. Overall, the ilUtil shortenText function is a useful tool for web developers who want to ensure that text remains readable even when limited in length.