Someone
public php v1 · immutable$data = html_entity_decode($data);preg_match("'<pre>(.*?)\n\n(.*?)</pre>'si", $data, $match);$body = $match[2];preg_match_all("/(\S+): (.*?)(?=(?:\n\S+:|$))/s", $match[1], $match, PREG_SET_ORDER);foreach ($match as $m) $headers[] = array($m[1] => preg_replace("/\n\s*/"," ",$m[2]));