Linux.com

Re:Filenames on the Fly

Posted by: Anonymous Coward on August 25, 2006 11:13 PM
A better way to achieve this would be a function like



function captcha_destroy_img() {

  $dir="/dir/to/captcha/images"

  $directory=opendir($dir);

  $file_array=array();

  while (($file = readdir($directory))!=false) {

    if (preg_match("/.png\$/",$file)) unlink($dir.$file);

  }

  closedir($directory);

}

#

Return to CAPTCHA your blog comments with FOSS utilities