开发者

Get URL image content using php

I have a url like this. http://www.cardekho.com/

If i w开发者_StackOverflow社区ish to get all the image content(jpg,png,gif - only images) from this url to my local machine(C:\images) - How to do this..

Please help me. Thanks - Haan


Use either cURL or PHP function file_get_content to get the source code and the source code for the css (if you want to get background-images aswell).

Then use preg_match_all and match all the image tags.

Loop all found image paths and use cURL or file_get_content to save the image to a local destination.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜