Documentation

TruncateText

string
TruncateText(
 string text,
 int Len
);

The function truncates the specified string to the maximum length of max_length. If a string is truncated, ellipsis are added.

Function parameters

ParameterDescription
text Source string.
Len Length of the target string.

See Also

Examples of use

<?
$str = "1234567890";
echo TruncateText($str, 7);
// prints "1234567..."
?>


© «Bitrix24», 2001-2022
Up