Parameter Position | Type | Required | Default | Description |
---|---|---|---|---|
1 | integer | No | 80 | This determines how many columns to wrap to. |
2 | string | No | \n | This is the string used to wrap words with. |
3 | boolean | No | false | This determines whether or not to wrap at a word boundary (false), or at the exact character (true). |
This wraps a string to a column width, default is 80. As an optional second parameter, you can specify a string of text to wrap the text to the next line (default is carriage return \n). By default, wordwrap will attempt to wrap at a word boundary. If you want to cut off at the exact character length, pass the optional third parameter of true.