开发者

PHP - fetch the images from email body

Can anyone guide me a way to extract all the images that are part of the email body(not a开发者_JAVA百科s attachment) in PHP. Please guide me if anyone has worked on this.

Regards, Justin Samuel.


Parse the HTML part with DOMDocument::loadHTML, get all <img> elements with getElementsByTagName('img'), check the src attribute of each <img> element, download the image (for example, using file_get_contents).


If there is image on an email, this one should be html.

So the image are define with a HTML tag like that

<img.....>

You have to look at the img HTML tag.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜