how do i get ALL images form a remote server using php/cURL

别等时光非礼了梦想. 提交于 2019-12-11 23:51:56

问题


There are many examples on how to get a single image, but what is the PHP way of getting ALL images


回答1:


Please read: http://curl.haxx.se/docs/faq.html#Can_I_do_recursive_fetches_with

You can probably call wget through php and do something similar like this.

wget -A png,jpeg,jpg -r http://www.yoursite.com &

This will spawn an asynchronous operation and download all file endings listed with the -A option.




回答2:


I found a webbot example in a book once.

Sample code :

http://www.schrenk.com/nostarch/webbots/scripts/reader.php?show=image_capture_bot.php

You can download the LIB_download_images.php required by visiting the link below : http://www.schrenk.com/nostarch/webbots/DSP_download.php

Good luck



来源:https://stackoverflow.com/questions/4630182/how-do-i-get-all-images-form-a-remote-server-using-php-curl

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!