Reputation: 1437
I'm trying to fetch all mail headers from an inbox using imap_headers($imap_resource) which returns an array of formatted string.
I want to know the proper/correct format of that returned string so I can parse/decode the string and break it down into date/subject/sender, etc.
Someone knows about this?
thanks
Upvotes: 1
Views: 1074
Reputation: 128
Just use imap_mime_header_decode(string $text)
for this.
This will return an array of objects, where each objects has two properties: charset
and text
. You can start doing that and use php string functions to get what you wanted.
Upvotes: 2