Swift_Mime_Headers_AbstractHeader::tokenNeedsEncoding PHP Method

tokenNeedsEncoding() protected method

Test if a token needs to be encoded or not.
protected tokenNeedsEncoding ( string $token ) : boolean
$token string
return boolean
    protected function tokenNeedsEncoding($token)
    {
        return preg_match('~[\\x00-\\x08\\x10-\\x19\\x7F-\\xFF\\r\\n]~', $token);
    }

Usage Example

 /**
  * Redefine the encoding requirements for mailboxes.
  *
  * Commas and semicolons are used to separate
  * multiple addresses, and should therefore be encoded
  *
  * @param string $token
  *
  * @return bool
  */
 protected function tokenNeedsEncoding($token)
 {
     return preg_match('/[,;]/', $token) || parent::tokenNeedsEncoding($token);
 }
All Usage Examples Of Swift_Mime_Headers_AbstractHeader::tokenNeedsEncoding