I was lightly probing this function's behavoir.
It handles rfc882 fields:
date
subject
message_id
to
from
reply-to
sender - will generate using 'from' field if not in
header
references
in-reply-to
cc
doesn't handle rfc882 fields:
return-path
received
resent- I think this field may be obsolete
keywords
If there are other rfc822 fields or behavoirs for the function, then I can't speak of them as they weren't in my test.
As it is relevent to what I'm currently doing I may add more about this function from time to time.
PHP.mk документација
imap_rfc822_parse_headers
Почист и полокален преглед на PHP референцата, со задржана структура од PHP.net и подобра читливост за примери, секции и белешки.
Патека
function.imap-rfc822-parse-headers.php
Локална патека за оваа страница.
Извор
php.net/manual/en
Оригиналниот HTML се реупотребува и локално се стилизира.
Режим
Прокси + превод во позадина
Кодовите, табелите и белешките остануваат читливи во истиот тек.
Референца
function.imap-rfc822-parse-headers.php
imap_rfc822_parse_headers
Референца за `function.imap-rfc822-parse-headers.php` со подобрена типографија и навигација.
imap_rfc822_parse_headers
(PHP 4, PHP 5, PHP 7, PHP 8)
imap_rfc822_parse_headers — Парсирај ги заглавијата на поштата од стринг
= NULL
Враќа објект од разни елементи на заглавието, слично на imap_header().
Параметри
headers-
Парсирани податоци за заглавијата
default_hostname-
Стандардното име на домаќинот
Вратени вредности
Враќа објект сличен на оној што го враќа imap_header(), освен знамињата и другите својства што доаѓаат од IMAP серверот.
Белешки од корисници 4 белешки
Кевин Каспер <casperke at gmail dot com> ¶
21 години пред
Марко Армент ¶
пред 15 години
This function will cause a PHP Fatal Error if the text you're passing to it overflows a 16 KB buffer internally (SENDBUFLEN in the source).
I haven't looked into it in depth yet, but limiting the input text to less than 16,384 characters still produced this in one error case on our servers, but reducing the boundary to 12,000 fixed it.
Most real-world mail headers are well under 4 KB.
phrank ¶
пред 17 години
This function is marked as internal function by the c-client library and should not be used by php directly.
Please be aware that the result will always contain fields that have not been set in the message. For example reply_to and sender will always be set even if there is no Reply-To and Sender header fields are defined in the message.
Sven dot Dickert at planb dot de ¶
пред 23 години
The object you get from imap_rfc822_parse_headers differs from the object you get from imap_headerinfo/imap_header in the following points. You won't get the:
* flags
* msgno
* size
* Maildate
* udate
* fetchfrom
* fetchsubject
udate can be simulated with
$headerobj=imap_rfc822_parse_headers ($header);
$udate=strtotime($headerobj->date);