Bitrix Site Manager

InsertSpaces

string
InsertSpaces(
 string text,
 int max_length = 80,
 string symbol = " "
)

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

Parameters

ParameterDescription
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.

See Also

Example



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