10-18-2007, 10:25 AM
|
#3 (permalink)
|
|
The Prestige
Join Date: Sep 2007
Location: Sweden, Stockholm
Posts: 1,080
Thanks: 115
|
So something like this then?
PHP Code:
$images = glob($path.'*.jpg', GLOB_BRACE | GLOB_NOSORT); $i = 0;
foreach($images as $image) {
if($image != $i) { $rename = rename($path.$image, $path.$i.$format) if($rename) { echo 'File: ' .$image. ' was renamed to ' .$i.$format; } else { echo 'File: ' .$image. ' could not be renamed to ' .$i.$format. ', please check your chmodding!'; } } else { echo 'File: ' .$image. ' was skipped because it has already the required name!'; }
$i++;
}
Yes?
|
|
|
|