SyntaxFix
Write A Post
Hire A Developer
Questions
You could use the rename() function :
rename('foo/test.php', 'bar/test.php');
This however will move the file not copy