Location: PHPKode > projects > EXtensible Production Suite (XPS) > xpsdev/helpers/xpm3/DOCUMENTATION/mime/split_content.html
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>XPM3_MIME::split_content()</title>
<style>
body, pre {
	font-family: Verdana;
	font-size: 10pt;
}
</style>
</head>
<body bgcolor="#f1f3f5" topmargin="10" leftmargin="14">

<pre>
XPM3_MIME :: <i>array</i> <b>split_content</b> ( <i>string</i> content )
<hr>
Returns an array with mail message components: <i>array</i> header, <i>string</i> multipart, <i>array</i> body.

Possible values for <i>string</i> multipart (if mail message is multipart format) are: yes or no.

Example:
<table border="0" bgcolor="white">
<tr><td>
<pre><code>
$txt = XPM3_MIME::message('Text message', 'text/plain');
$htm = XPM3_MIME::message('HTML message', 'text/html');

// compose a mail message
$msg = XPM3_MIME::compose($txt, $htm);
$dat = $msg['addheader']."\r\n\r\n".$msg['body'];
// echo $dat;

// split
$spl = XPM3_MIME::split_content($dat);

// print result
print_r($spl);

/* will print:
Array
(
    [header] => Array
        (
            [0] => Array
                (
                    [MIME-Version] => 1.0
                )

            [1] => Array
                (
                    [Content-Type] => multipart/alternative; boundary="=_954f1ebf1717231c6aa9d702f009debc"
                )

        )

    [multipart] => yes
    [body] => Array
        (
            [0] => Array
                (
                    [Content-Type] => text/plain; charset="us-ascii"
                    [Content-Transfer-Encoding] => quoted-printable
                    [Content-Disposition] => inline
                    [multipart] => alternative
                    [data] => Text message

                )

            [1] => Array
                (
                    [Content-Type] => text/html; charset="us-ascii"
                    [Content-Transfer-Encoding] => quoted-printable
                    [Content-Disposition] => inline
                    [multipart] => alternative
                    [data] => HTML message

                )

        )

)
*/
</code></pre>
</td></tr>
</table>

<hr color="white">

[ <a style="color: blue; text-decoration: none" href="mailto:hide@address.com?subject=Comment XPM3_MIME split_content">Comments</a> ]

Last update: Monday, January 22, 2007

</pre>

</body>
</html>
Return current item: EXtensible Production Suite (XPS)