note 49809 added to function.file-get-contents

From: Date: Wed, 09 Feb 2005 07:57:21 +0000
Subject: note 49809 added to function.file-get-contents
Groups: php.notes 
Request: Send a blank email to php-notes+get-84705@lists.php.net to get a copy of this message
This is a simple function to save a website's content into a file on your server. You are able to backup your files with this function. (note that only the HTML-Output will be copied, not the database contents you may use to generate the contents of your website) <?php //file where the backup will be saved to $file = fopen('ftp://user:password@ftp.host.com/dir/targetfile', 'w'); // save the contents of the website to the file defined in "$file" fwrite($file, file_get_contents('http://www.domainx.org/index.html')); //close fclose($file); ?> ---- Manual Page -- http://www.php.net/manual/en/function.file-get-contents.php Edit -- http://master.php.net/manage/user-notes.php?action=edit+49809 Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+49809&report=yes&reason=added+to+the+manual Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+49809&report=yes&reason=bad+code Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+49809&report=yes&reason=spam Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+49809&report=yes&reason=useless Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+49809&report=yes Reject -- http://master.php.net/manage/user-notes.php?action=reject+49809&report=yes Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#84705) next »