+function listaImagenes($dir = '.', $prepend = '', $append = '') {
+ $lista = array('' => '--');
+ $d = dir($dir);
+ while (($file = $d->read()) !== false) {
+ if (preg_match("/$prepend(.*)$append/", $file, $m)) {
+ $nombre = ucwords(join(' ', preg_split('/_/', $m[1])));
+ $lista[$file] = $nombre;
+ }
+ }
+ return $lista;
+}
+
+?>
\ No newline at end of file