src/BoomCMS/Support/Str.php
public static function nl2paragraph($text)
    {
        $paragraphs = explode("\n", $text);

        foreach ($paragraphs as &$paragraph) {
            $paragraph = "<p>$paragraph</p>";
        }

        return implode('', $paragraphs);
    }
public static function nl2paragraph($text)
    {
        $paragraphs = explode("\n", $text);

        foreach ($paragraphs as &$paragraph) {
            $paragraph = "<p>$paragraph</p>";
        }

        return implode('', $paragraphs);
    }
public static function nl2paragraph ( $ text ) { $ paragraphs = explode ( "\n" , $ text ) ; foreach ( $ paragraphs as & $ paragraph ) { $ paragraph = "<p>$paragraph</p>" ; } return implode ( '' , $ paragraphs ) ; }
Adds paragraph HTML tags to text treating each new line as a paragraph break.

@param string $text

@return string
Adds paragraph HTML tags to text treating each new line as a paragraph break .