When you run this script does it make an exact copy of index.php to index.html? As in an unparsed php script? because that's what you are doing here. You are saying open "index.php" and put its contents into "index.html"
This function may have been intended to copy rendered pages into static pages. (as hinted by the function name "wwwcopy"). fopen() afterall is intended to work with urls as well as physical files.
Here's my test:
function wwwcopy($link,$file)
{
$fp = fopen($link,"r");
while(!feof($fp))
{
$cont.= fread($fp,1024);
}
fclose($fp);
$fp2 = fopen($file,"w");
fwrite($fp2,$cont);
fclose($fp2);
}
wwwcopy("http://blog.rvdavid.net/", "index.html");
As you can see, it takes the rendered html output from the URL http://blog.rvdavid.net and saves it into index.html
For this type of functionality to work however you will need to have allow_url_fopen enabled.
HTH. 🙂