rename with glob
Posted: Thu Sep 09, 2010 10:23 am
the code:
the error:
Code: Select all
<?php
foreach(glob("D:/dir/dir/*.csv") as $n => $file) {
$new = dirname($file) . '/' . sprintf("%04d", $n + 1) . 'D:/dir/dir/test/*.csv';
rename($file, $new);
}
?>what could it be????Warning: rename(D:/dir/dir/file1.csv,D:/dir/dir/0001D:/dir/dir/test/file1.csv) [function.rename]: No error in C:\wamp\www\move.php on line 6
Warning: rename(D:/dir/dir/file2.csv,D:/dir/dir/0002D:/dir/dir/test/file2.csv) [function.rename]: No error in C:\wamp\www\move.php on line 6