← All built-ins / wordwrap()
wordwrap()
wordwrap(...$args): string
Parameters
| Name | Type | Description |
|---|---|---|
| $s | string | input string |
| $width | int | target line width |
| $break | string | line break string, default "\n"optional |
Return value
The string wrapped at word boundaries.
Example
echo wordwrap("holy php makes coding holy again", 12), "
";holy php makes coding holy again