I'm making a web page for a company that they can go to and fill out a form and it will create a copy of a directory, rename the directory, and change only one file (.php
) that contains the property information. I then want to use fwrite()
or something like that to change the data inside information.php. What is the best way to do this? Can I use the PHP copy()
function on a directory? Could I write something like this:
rename(copy('directory/to/copy'), 'path/to/new_dir');
and then
fwrite('path/to/new_dir/information.php', $predefined_string_of_php_code);
Thanks a lot... I am completely new to all file system/directory functions in php, so... yeah.
Also, when I use the copy()
function or something similar, will I actually see the new file/folder in the FTP? Could I later delete it if I was just testing it out?