Jetoox
Jetoox

Reputation: 1437

imap_headers return string format

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

Answers (1)

user1971075
user1971075

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

Related Questions