Php is generating the page correct?
Then you can view the source of this page, which php generated and save that, correct?
So what if, instead of just echoing the content to the browser you placed it into a variable in php?
Then you used fwrite to write that variable to a file?
That's all I'm saying to do.