Snippets tagged “truncate”
2 snippets use this tag.
- How to Truncate a string in PHP to the word closest to a certain number of characters?PHP
To truncate a string in PHP to the word closest to a certain number of characters, you can use the following code:
- Truncate a string to first n characters of a string and add three dots if any characters are removedPHP
To truncate a string to the first n characters and add three dots if any characters are removed in PHP, you can use the following function.