truncateWords() public static method
Truncates a string to the number of words specified.
public static string truncateWords ( $string, $count, $suffix = '...', $asHtml = false ) | ||
---|---|---|
$string | string |
The string to truncate. |
$count | integer |
How many words from original string to include into truncated string. |
$suffix | string |
String to append to the end of truncated string. |
$asHtml | boolean |
Whether to treat the string being truncated as HTML and preserve proper HTML tags. This parameter is available since version 2.0.1. |
return | string |
The truncated string. |
Please login to continue.