crop_str()
crop_str(string $string, int $length) : string
Truncates a string to be shorter than or equal to the length specified Attempts to truncate on word boundaries
Parameters
string | $string | |
int | $length |
Helper functions for shared use in the services files
crop_html(string $string, int $length, array $allowed_tags) : string
Truncates HTML so that its textContent (text without markup) is shorter than or equal to the length specified.
The length of the returned string may be larger than the specified length due to the markup. Attempts to truncate on word boundaries.
string | $string | |
int | $length | |
array | $allowed_tags | KSES input |