0

I am trying to move a file from one place to another with PHP. All of my attempts have failed. I have tried:

rename("C:\Users\Eli\Desktop\NEWWAMP\wamp\www\Tyler\whaley.html", "C:\Users\Eli\Desktop\NEWWAMP\wamp\www\Tyler\Games\whaley.html");

and:

rename("whaley.html", "Games/whaley.html");

and I get errors for both of those.

See the link for a visual of my problem.

My problem

JAL
  • 41,701
  • 23
  • 172
  • 300
TyGuy1016
  • 52
  • 6

1 Answers1

0
copy (string source, string dest)
Misa Lazovic
  • 2,805
  • 10
  • 32
  • 38
Michael
  • 1,089
  • 1
  • 11
  • 28
  • copy does not move file it copies file as the name of function says – Robert Feb 11 '16 at 15:54
  • 1
    Moving is *almost* the same as copying and then removing the source file. :) – Werner Feb 11 '16 at 16:06
  • @Mitch not quite because manual says http://php.net/rename "Attempts to rename oldname to newname, moving it between directories if necessary" – Robert Feb 11 '16 at 21:13