I have been playing with this code for a bit now and still confused on how this is to work.
I want to
open a file on my server
copy it / rename it
do a find and replace
and be able to view that file
I can get everything done but the last step
$fp = fopen("http://www.server.com/temp.html","r");
if ($fp)
{ print"The file exists!"; }
else
{ print"The file does not exist";
}
I was able to do the copy and rename commands really easy but when I tried to replace it just didn't do anything.
$fp = str_replace('oldstring', 'newstring', $fp);
Do I need to write that back out to the file or should it have already happened?