A PHP library for parsing (and generating) RFC1341 Multipart.
Finally a Multipart parser library for PHP!
$content = '--------------------------eb2d2b296b73a011' . "\r\n"
. 'Content-Disposition: form-data; name="foo"' . "\r\n"
. 'Content-Type: text/plain' . "\r\n\r\n"
. 'bar' . "\r\n"
. 'buz' . "\r\n"
. '--------------------------eb2d2b296b73a011--' . "\r\n";
$contentType = 'multipart/form-data; boundary=a3d8fcba372c456a';
$parserSelector = new ParserSelector();
$parser = $parserSelector->getParserForContentType($contentType);
$multipart = $parser->parse($content);
var_dump($multipart);
I needed a multipart parser, so a wrote one. If anybody would like to write a Generator, do so :)