PHP function wordwrap()
Availability in versions: PHP 4.0.2
Wraps a string to the specified number of characters
Parameters
| Parameter | Data type | Default value | Note |
|---|---|---|---|
$str |
string |
not | String being processed. |
$width |
int |
75, | column width. |
$break |
string |
"\n", | The string is broken using the optional break parameter. |
$cut |
bool |
false | If the cut parameter is set to true, the string will always wrap at or before the specified width. Thus, if the word is larger than the specified width, it is split. (See the second example). |
Return values
string
The given string wrapped in the specified column.