public static function wordWrap($text, $width = 72, $break = "\n", $cut = false)
    {
        $paragraphs = explode($break, $text);
        foreach ($paragraphs as &$paragraph) {
            $paragraph = static::_wordWrap($paragraph, $width, $break, $cut);
        }

        return implode($break, $paragraphs);
    }
public static function wordWrap($text, $width = 72, $break = "\n", $cut = false)
    {
        $paragraphs = explode($break, $text);
        foreach ($paragraphs as &$paragraph) {
            $paragraph = static::_wordWrap($paragraph, $width, $break, $cut);
        }

        return implode($break, $paragraphs);
    }
public static function wordWrap ( $ text , $ width = 72 , $ break = "\n" , $ cut = false ) { $ paragraphs = explode ( $ break , $ text ) ; foreach ( $ paragraphs as & $ paragraph ) { $ paragraph = static :: _wordWrap ( $ paragraph , $ width , $ break , $ cut ) ; } return implode ( $ break , $ paragraphs ) ; }
Unicode and newline aware version of wordwrap.

@param string $text The text to format.
@param int $width The width to wrap to. Defaults to 72.
@param string $break The line is broken using the optional break parameter. Defaults to '\n'.
@param bool $cut If the cut is set to true, the string is always wrapped at the specified width.
@return string Formatted text.
Unicode and newline aware version of wordwrap .