Zend Framework  2.4
Static Public Member Functions | List of all members
Decode Class Reference

Static Public Member Functions

static splitMime ($body, $boundary)
 Explode MIME multipart string into separate parts.
 
static splitMessageStruct ($message, $boundary, $EOL=Mime::LINEEND)
 decodes a mime encoded String and returns a struct of parts with header and body
 
static splitMessage ($message, &$headers, &$body, $EOL=Mime::LINEEND, $strict=false)
 split a message in header and body part, if no header or an invalid header is found $headers is empty
 
static splitContentType ($type, $wantedPart=null)
 split a content type in its different parts
 
static splitHeaderField ($field, $wantedPart=null, $firstName= '0')
 split a header field like content type in its different parts
 
static decodeQuotedPrintable ($string)
 decode a quoted printable encoded string
 

Member Function Documentation

static decodeQuotedPrintable (   $string)
static

decode a quoted printable encoded string

The charset of the returned string depends on your iconv settings.

Parameters
string$stringencoded string
Returns
string decoded string
static splitContentType (   $type,
  $wantedPart = null 
)
static

split a content type in its different parts

Parameters
string$typecontent-type
string$wantedPartthe wanted part, else an array with all parts is returned
Returns
string|array wanted part or all parts as array('type' => content-type, partname => value)
static splitHeaderField (   $field,
  $wantedPart = null,
  $firstName = '0' 
)
static

split a header field like content type in its different parts

Parameters
string$fieldheader field
string$wantedPartthe wanted part, else an array with all parts is returned
string$firstNamekey name for the first part
Returns
string|array wanted part or all parts as array($firstName => firstPart, partname => value)
Exceptions
Exception\RuntimeException
static splitMessage (   $message,
$headers,
$body,
  $EOL = Mime::LINEEND,
  $strict = false 
)
static

split a message in header and body part, if no header or an invalid header is found $headers is empty

The charset of the returned headers depend on your iconv settings.

Parameters
string | Headers$messageraw message with header and optional content
Headers$headersoutput param, headers container
string$bodyoutput param, content of message
string$EOLEOL string; defaults to ::LINEEND
bool$strictenable strict mode for parsing message
Returns
null
static splitMessageStruct (   $message,
  $boundary,
  $EOL = Mime::LINEEND 
)
static

decodes a mime encoded String and returns a struct of parts with header and body

Parameters
string$messageraw message content
string$boundaryboundary as found in content-type
string$EOLEOL string; defaults to ::LINEEND
Returns
array|null parts as array('header' => array(name => value), 'body' => content), null if no parts found
Exceptions
Exception\RuntimeException
static splitMime (   $body,
  $boundary 
)
static

Explode MIME multipart string into separate parts.

Parts consist of the header and the body of each MIME part.

Parameters
string$bodyraw body of message
string$boundaryboundary as found in content-type
Returns
array parts with content of each part, empty if no parts found
Exceptions
Exception\RuntimeException