Documentation

InsertSpaces

string
InsertSpaces(
 string text,
 int MaxChar = 80,
 string symbol = " ",
 bool HTML=false
);

The function splits long words in a text. Returns the text containing words of the specified length.

Function parameters

ParameterDescription Available from version
text Original text.
max_length The maximum number of symbols in a word. The longer words are split with the symbol specified in the parameter symbol.
symbol Symbol used to split words whose length exceeds that specified in max_length.
HTML Optional. By default - false.

See Also

Examples of use

<?
$str = "1234567890 1234 123456";
echo InsertSpaces($str, 5);
// prints "12345 67890 1234 12345 6"
?>


© «Bitrix24», 2001-2024