Copy a file to all sub-directories with PHP

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • walkingkeyboard
    New Member
    • Mar 2007
    • 1

    #1

    Copy a file to all sub-directories with PHP

    I am looking for a way to copy a PHP file to all directories under a specified directory. Any thoughts on what would be the best way to do this?
  • ronverdonk
    Recognized Expert Specialist
    • Jul 2006
    • 4259

    #2
    Yes. As follows:
    Code:
    -  read all files your current directory
    -  filter the subdirectories out and store in array
    -  for each entry in the array: 
       - copy the file to each subdirectory
    Ronald :cool:

    Comment

    Working...