This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* truncateHtml can truncate a string up to a number of characters while preserving whole words and HTML tags | |
* | |
* @param string $text String to truncate. | |
* @param integer $length Length of returned string, including ellipsis. | |
* @param string $ending Ending to be appended to the trimmed string. | |
* @param boolean $exact If false, $text will not be cut mid-word | |
* @param boolean $considerHtml If true, HTML tags would be handled correctly | |
* |