Im working on a shopping cart solution for my client. The shopping cart is smart enough to associate file names with product id's so what i have to do is rename each image file name to associate it with a product id. (ie. product_id1 and product_id1.jpg)
$filename;
function renamer(){
foreach(glob('./my_images/*.*') as $filename){
for($i =0; $i<10;$i++ ){
rename($filename, "/my_images/product_id".$i.".jpg");
}
}
}
renamer();
For some reason the files are not being renamed. I get an error message:
The system cannot find the path specified. (code: 3)