original_string: public static function encodeBase64Header($str,
          $charset,
          $lineLength = self::LINELENGTH,
          $lineEnd = self::LINEEND)
      {
          $prefix = '=?' . $charset . '?B?';
          $suffix = '?=';
          $remainingLength = $lineLength - strlen($prefix) - strlen($suffix);
  
          $encodedValue = self::encodeBase64($str, $remainingLength, $lineEnd);
          $encodedValue = str_replace($lineEnd, $suffix . $lineEnd . ' ' . $prefix, $encodedValue);
          $encodedValue = $prefix . $encodedValue . $suffix;
          return $encodedValue;
      }
code: public static function encodeBase64Header($str,
          $charset,
          $lineLength = self::LINELENGTH,
          $lineEnd = self::LINEEND)
      {
          $prefix = '=?' . $charset . '?B?';
          $suffix = '?=';
          $remainingLength = $lineLength - strlen($prefix) - strlen($suffix);
  
          $encodedValue = self::encodeBase64($str, $remainingLength, $lineEnd);
          $encodedValue = str_replace($lineEnd, $suffix . $lineEnd . ' ' . $prefix, $encodedValue);
          $encodedValue = $prefix . $encodedValue . $suffix;
          return $encodedValue;
      }
code_tokens: public static function encodeBase64Header ( $ str , $ charset , $ lineLength = self :: LINELENGTH , $ lineEnd = self :: LINEEND ) { $ prefix = '=?' . $ charset . '?B?' ; $ suffix = '?=' ; $ remainingLength = $ lineLength - strlen ( $ prefix ) - strlen ( $ suffix ) ; $ encodedValue = self :: encodeBase64 ( $ str , $ remainingLength , $ lineEnd ) ; $ encodedValue = str_replace ( $ lineEnd , $ suffix . $ lineEnd . ' ' . $ prefix , $ encodedValue ) ; $ encodedValue = $ prefix . $ encodedValue . $ suffix ; return $ encodedValue ; }
docstring: Encode a given string in mail header compatible base64 encoding.
  
  @param string $str
  @param string $charset
  @param int $lineLength Defaults to {@link LINELENGTH}
  @param int $lineEnd Defaults to {@link LINEEND}
  @return string
docstring_tokens: Encode a given string in mail header compatible base64 encoding .