$sanitizerremoveNewlines()

Remove newlines from the given string and return it

Usage

// basic usage
$string = $sanitizer->removeNewlines(string $str);

// usage with all arguments
$string = $sanitizer->removeNewlines(string $str, string $replacement = ' ');

Arguments

NameType(s)Description
$strstring

String to remove newlines from

$replacement (optional)string

Character to replace newlines with Default:" "

Return value

string

String without newlines


$sanitizer methods and properties

API reference based on ProcessWire core version 3.0.251