php - How to: Copy files from a source to a destination -


i looking way have files in source, say:

/public_html/source/sourcefiles/ 

and when, in admin panel, create new 'game' (in case), might called category, or et cetera in other projects, copy source files directory such as:

/public_html/games/gamename/sourcefiles_copied_here/ 

is there way this?

if possible, i'd need way delete them when game/category deleted.

http://php.net/manual/en/function.copy.php


the php copy function useful copying files source, new directory.

it used this:

copy(sourcedir, destdir);

keep in mind files exist in destination directory same name files being copied overwritten.

to move file, use rename function.


Comments

Popular posts from this blog

Perl - how to grep a block of text from a file -

delphi - How to remove all the grips on a coolbar if I have several coolbands? -

javascript - Animating array of divs; only the final element is modified -