abdfahim Posted October 27, 2010 Share Posted October 27, 2010 Hi, I want to save an webpage into my server location, as simple as that. At present, I am reading the content of the file using curl, save that content into a text file, then save that text file. I assume there must be some straightforward way just to save www.example.com/file.html into my server directory as file.html. Can anyone help me on this, please? Thanks, -Abd Quote Link to comment https://forums.phpfreaks.com/topic/216973-save-webpage/ Share on other sites More sharing options...
trq Posted October 27, 2010 Share Posted October 27, 2010 <?php file_put_contents('file.html', file_get_contents('http://example.com/file.html')); ?> Quote Link to comment https://forums.phpfreaks.com/topic/216973-save-webpage/#findComment-1127044 Share on other sites More sharing options...
abdfahim Posted October 27, 2010 Author Share Posted October 27, 2010 Thanks Thorpe. But the problem is, for some reason, my hosting doesn't support file_get_contents, but it do support Curl. Quote Link to comment https://forums.phpfreaks.com/topic/216973-save-webpage/#findComment-1127091 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.