Name

wordwrap

Synopsis

string wordwrap(string string[, int size[, string postfix[, int force]]])

Inserts postfix into string every size characters and at the end of the string, and returns the resulting string. While inserting breaks, the function attempts to not break in the middle of a word. If not specified, postfix defaults to \r\n and size defaults to 76. If force is given and is true, the string is always wrapped to the given length (this makes the function behave the same as chunk_split( )).

Get Programming PHP now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.