Current Directory
Xmls / various files here ...
I want to pass all files from within Xmls to
Xmls / XmlsLidos
I tried to do with copy
and then use unlink
, but it did not work.
Current Directory
Xmls / various files here ...
I want to pass all files from within Xmls to
Xmls / XmlsLidos
I tried to do with copy
and then use unlink
, but it did not work.
This is a process that can be done with the function, glob and rename :
<?php
// pega a lista de arquivos com a extensão xml.
$list = glob(__dir__.'/xml/*.xml');
// diretorio aonde serão remanejados.
$save = __dir__.'/xmllido/';
foreach ($list as $value) {
if (rename($value, $save.basename($value))) {
echo 'item enviado com exito';
}
}