fork download
  1. <?php
  2. $dir='download/jpg/';
  3. $new_dir='123/';
  4. $maska='.jpg';
  5. if (is_dir($dir)) {
  6. foreach(array_diff(scandir($dir), array('.', '..')) as $file) {
  7. if($myfile = stristr($file, $maska)) {
  8. $filename=$dir.$file;
  9. $new_name=preg_replace ('/name_[0-9]{10}/i', '', $file);
  10. rename($dir.$file, $new_dir.$new_name);
  11. }
  12. }
  13. }
  14. ?>
Success #stdin #stdout 0.02s 13112KB
stdin
Standard input is empty
stdout
Standard output is empty