1 # http\Message http\Message::splitMultipartBody()
3 Splits the body of a multipart message.
4 See http\Message::isMultipart() and http\Message\Body::addPart().
12 * http\Message, a message chain of all messages of the multipart body.
17 $body = new http\Message\Body;
18 $body->addPart(new http\Message("Content-type: text/plain\n\nHello "));
19 $body->addPart(new http\Message("Content-type: text/plain\n\nWorld!"));
21 $msg = new http\Message;
22 $msg->setHeader("Content-Type",
23 "multipart/mixed; boundary=" . $body->getBoundary());
25 var_dump($msg->isMultipart($bnd), $bnd);
27 $parts = $msg->splitMultipartBody();
28 var_dump(count($parts));
29 foreach ($parts->reverse() as $part) {
30 echo $part->getBody();
37 string(17) "16658735.3fe37486"