PHP script to download a website with its files -
i need php script similar "save page as" button in firefox or other browsers. is: given url, downloads associated html file, images , other files displayed in it. file_get_contents()
function gets me halfway there, getting html file not images or other files. solution read through html returned file_get_contents()
, every file link found, apply file_get_contents()
it. yet suspect there must more standard solution already. in advance.
the easiest way use wget
command:
wget --page-requisites http://www.yourwebsite.com/directory/file.html
from php can invoke using exec
or system
.