Moving files into directory in foreach loop?

nismorules

New Member
hey guys,i've no idea how to do that and need your help!i have an array of filenames called $bundle. (file_one.jpg, file_two.pdf, file_three.etc)and i have the name of the folder stored in $folder. (my_directory)i now would like to move all the files stored in $bundle to move to the directory $folder.how can i do that?\[code\] //print count($bundle); //(file_one.jpg, file_two.pdf, file_three.jpg) $folder = $folder = PATH . '/' . my_directory; foreach ($bundle as $value) { //rename(PATH.'/'.$value, $folder . '/' . $value); }\[/code\]just so it's not confusing: PATH just stores the local file-path im using for my project. in my case it's just the folder i'm working in-so it's "files".i have no idea which method i have to use for this and how i could solve that!thank you for your help!
 
Back
Top