Ouzo\Utilities\Strings::escapeNewLines PHP Method

escapeNewLines() public static method

Example: $string = "My name is Reek \nit rhymes with leek"; $escaped = Strings::escapeNewLines($string); Result: My name is <strong>Reek</strong>
it rhymes with leek
public static escapeNewLines ( string $string ) : string
$string string
return string
    public static function escapeNewLines($string)
    {
        $string = htmlspecialchars($string);
        return nl2br($string);
    }

Usage Example

Example #1
0
function escapeNewLine($text)
{
    return Strings::escapeNewLines($text);
}
All Usage Examples Of Ouzo\Utilities\Strings::escapeNewLines