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 | |
/** | |
* Truncates text. | |
* | |
* Cuts a string to the length of $length and replaces the last characters | |
* with the ending if the text is longer than length. | |
* | |
* @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. |