File move/copy and get array of file link as return

Whats in this post?

  • File System
  • Copy/Move
  • Get the output of file-link in an single dimension array

This code can be used to copy or move file from one folder to another. This code support multilayer folder copy/move. Recursive function have been used to copy or move files. If there sub folder in a folder it’s also get copied or moved. As a return you will get a single dimension array as return. like:


[0] => D:/wamp/www/fileMover/new/another/avatar.jpg
[1] => D:/wamp/www/fileMover/new/another/avatar_1.png
[2] => D:/wamp/www/fileMover/new/another/avatar_2.png
[3] => D:/wamp/www/fileMover/new/avatar.jpg
[4] => D:/wamp/www/fileMover/new/avatar_1.png
[5] => D:/wamp/www/fileMover/new/avatar_2.png
[6] => D:/wamp/www/fileMover/new/avatar_3.png
[7] => D:/wamp/www/fileMover/new/avatar_4.png
[8] => D:/wamp/www/fileMover/new/avatar_5.png
[9] => D:/wamp/www/fileMover/new/avatar_default.jpg


To copy code: Click View Source “View Source” on the right of this code snippet.