PHPMailer\PHPMailer
PHPMailer::quotedString
If a string contains any "special" characters, double-quote the name, and escape any double quotes with a backslash.
Метод класса: PHPMailer{}
Хуков нет.
Возвращает
Строку.
Использование
$result = PHPMailer::quotedString( $str );
- $str(строка) (обязательный)
- .
Заметки
- Смотрите: RFC822 3.4.1
Код PHPMailer::quotedString() PHPMailer::quotedString WP 7.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;
}