Gen. partnerAlgotech

PHP function wordwrap()

Wraps a string to the specified number of characters

|
September 11, 2019

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.

Other resources

Official wordwrap documentation

Loading comments...

Stay in the loop

Subscribe to our newsletter and get the latest cybersecurity news delivered straight to your inbox.

Your data is safe. You can unsubscribe from the newsletter at any time.