문제

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

도움이 되었습니까?

해결책

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.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top