WordPress at a glance
function is not described

PHPMailer\PHPMailer

PHPMailer::quotedString() public WP 1.0

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() WP 5.7.2

<?php
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;
}