note 25980 added to function.file-get-contents

From: Date: Mon, 14 Oct 2002 10:02:46 +0000
Subject: note 25980 added to function.file-get-contents
Groups: php.notes 
Request: Send a blank email to php-notes+get-38042@lists.php.net to get a copy of this message
My php-installation didn't have file_get_contents so I implemented my own version. It takes to args, source URL to download from and target local path to save to... enjoy function download($url, $local) { $readfile = @fopen($url, "rb"); $writefile = @fopen($local, "wb"); while (!feof($readfile)) fwrite($writefile, fread($readfile, 65535)); fclose($readfile); fclose($writefile); } -- http://www.php.net/manual/en/function.file-get-contents.php http://master.php.net/manage/user-notes.php?action=edit+25980 http://master.php.net/manage/user-notes.php?action=delete+25980 http://master.php.net/manage/user-notes.php?action=reject+25980

« previous php.notes (#38042) next »