PHPMailer\PHPMailer
PHPMailer::quotedString()
If a string contains any "special" characters, double-quote the name, and escape any double quotes with a backslash.
{} It's a method of the class: PHPMailer{}
No Hooks.
Return
String
.
Usage
$result = PHPMailer::quotedString( $str );
- $str(string) (required)
- -
Notes
- See: RFC822 3.4.1
Code of PHPMailer::quotedString() PHPMailer::quotedString WP 6.0
public static function quotedString($str) { if (preg_match('/[ ()<>@,;:"\/\[\]?=]/', $str)) { //If the string contains any of these chars, it must be double-quoted //and any double quotes must be escaped with a backslash return '"' . str_replace('"', '\\"', $str) . '"'; } //Return the string untouched, it doesn't need quoting return $str; }