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.
精彩评论