Skip to main content

Zymba Documentation

MIME

object @MIME() {
createMultipart(object $parts, string $boundary, string $preamble, string $epilog): string {}
fromBase64(string $string): string {}
fromBase64URL(string $string): string {}
fromEncodedWord(string $string): string {}
fromQuotedPrintable(string $string): string {}
isPrintable(string $string): bool {}
parseMultipart(string $body, ?string $boundary): object {}
toBase64(string $string): string {}
toBase64Raw(string $string): string {}
toBase64URL(string $string): string {}
toEncodedWord(string $string): string {}
toQuotedPrintable(string $string): string {}
}

Static MIME related functions.

Functions

@MIME.createMultipart(object $parts, string $boundary, string $preamble, string $epilog): string
Parameters
NameTypeValueDefault
partsobject[]
boundarystring""
preamblestring""
epilogstring""
Returns
TypeValue
string

Decodes a string according to RFC 2045 by converting printable characters back to arbitrary byte sequences.

@MIME.fromBase64(string $string): string
Parameters
NameTypeValueDefault
stringstring""
Returns
TypeValue
string

Decodes a string according to RFC 2045 by converting printable characters back to arbitrary byte sequences, but using an URL and filename safe alphabet as per RFC 4648.

@MIME.fromBase64URL(string $string): string
Parameters
NameTypeValueDefault
stringstring""
Returns
TypeValue
string
@MIME.fromEncodedWord(string $string): string
Parameters
NameTypeValueDefault
stringstring""
Returns
TypeValue
string

Decodes a string according to RFC 2045 by replacing sequences incipient with an equal sign ("=") followed by a 2-character hexadecimal number with their applicable characters.

@MIME.fromQuotedPrintable(string $string): string
Parameters
NameTypeValueDefault
stringstring""
Returns
TypeValue
string
@MIME.isPrintable(string $string): bool
Parameters
NameTypeValueDefault
stringstring""
Returns
TypeValue
bool
@MIME.parseMultipart(string $body, ?string $boundary): object
Parameters
NameTypeValueDefault
bodystring""
boundary?stringdetect
Returns
TypeValue
object[part, ...]
null

Encodes a string in lines of no more than 76 bytes according to RFC 2045 using a 65-character printable subset of US-ASCII to represent arbitrary byte sequences.

@MIME.toBase64(string $string): string
Parameters
NameTypeValueDefault
stringstring""
Returns
TypeValue
string

Encodes a string without line breaks according to RFC 2045 using a 65-character printable subset of US-ASCII to represent arbitrary byte sequences.

@MIME.toBase64Raw(string $string): string
Parameters
NameTypeValueDefault
stringstring""
Returns
TypeValue
string

Encodes a string without line breaks according to RFC 2045 using a 65-character printable subset of US-ASCII to represent arbitrary byte sequences, but using an URL and filename safe alphabet as per RFC 4648.

@MIME.toBase64URL(string $string): string
Parameters
NameTypeValueDefault
stringstring""
Returns
TypeValue
string
@MIME.toEncodedWord(string $string): string
Parameters
NameTypeValueDefault
stringstring""
Returns
TypeValue
string

Encodes a string in lines of no more than 76 bytes according to RFC 2045 by replacing every unprintable character with an equal sign ("=") followed by a 2-character hexadecimal number.

@MIME.toQuotedPrintable(string $string): string
Parameters
NameTypeValueDefault
stringstring""
Returns
TypeValue
string