There are excellent shell scripts for downloading websites from Archive.org's Wayback Machine, but I could not find an existing, publicly available script for doing it with PHP, so using a shell script for an example, I made one in PHP.
INSTRUCTIONS
Create a folder with a random name on your site for the scripts to run inside.
Edit variables in getfile.php and process.php
Run getfile.php to create the rawlist.json file.
Then run process.php to download the site you want.
Questions: LilPeck@gmail.com