note 91148 deleted from function.imap-fetchheader by danbrown
| From: | danbrown@php.net | Date: | Wed, 27 May 2009 15:43:06 +0000 |
| Subject: | note 91148 deleted from function.imap-fetchheader by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-156084@lists.php.net to get a copy of this message | ||
Note Submitter: luca dot capra at gmail com
----
<?php
Thanks Jille at nomorecrap dot quis dot cx
function imap_fetchheader_assoc($imap, $msgid){
$headers=imap_fetchheader($imap, $msgid);
preg_match_all('/([^: ]+): (.+?(?:\r\n\s(?:.+?))*)\r\n/m', $headers, $matches);
preg_replace('/\r\n\s+/m', '', $matches[2]);
return array_combine($matches[1], $matches[2]);
}
$headers = imap_fetchheader_assoc($imap, $msgid);
?>