class.upload.php is a powerful and mature PHP class to manage uploaded files, and manipulate images in many ways. The script is available under a GPL license.
more info about the class
$files = array('pic1.jpg', 'pic2.jpg', 'pic3.jpg'); foreach ($files as $file) { $handle = new Upload($file); if ($handle->uploaded) { $handle->image_resize = true; $handle->image_ratio_y = true; $handle->image_x = 100; $handle->Process('destination_directory/'); } }
You first get all your file names in an array, and then loop through it, instantiating the class each time with each file name.