How to copy few files from one folder to another folder in php and delete them in source folder
<p>How to copy files from one folder to another folder in php and delete them in source folder ? </p>

<p>I have two folder <code>$incoming_file_path = /home/xmlcontainer</code> and <code>$processing_file_path = home/process_file</code>. I am looping through all files in <code>$incoming_file_path  = home/xmlcontainer</code> and than copying it into <code>$processing_file_path = home/process_file</code>. </p>

<p>After executing below code I am not able to copy the content of files but just the name of the files also am not able to delete files which I have copies to destination folder from source folder using <code>unlink</code>, I am surely using unlink in wrong way and would certainly appreciate any guidance on it. </p>

<p>Code </p>

<pre><code>foreach( glob($incoming_file_path.'/*')as $key =&gt; $value ) {
    copy($incoming_file_path.$value,$processing_file_path.$value);
    unlink($incoming_file_path.$value); 
    }
</code></pre>
