Recetas Milkaut
$no_cache = "no_cache=" . rand(); header("Cache-Control: no-store, no-cache, must-revalidate"); header("Cache-Control: post-check=0, pre-check=0", false); ?> // devuelve un array con la lista de archivos coincidentes con el patrón // similar a dir *.txt // el patron es la parte comun del nombre de archivo // ej: $pattern = "_inst_pagina_1.jpg"; va a matchear *_inst_pagina_1.jpg function list_files($pattern, $path) { $res = array(); $dir = opendir($path); while ($file = readdir($dir)) { if (preg_match("/{$pattern}/", $file)) array_push($res, $file); } closedir($dir); return $res; } function file_name($name) { $ext = strrchr($name, '.'); if($ext !== false) $name = substr($name, 0, -strlen($ext)); return $name; } function file_ext($name) { return strtolower(end(explode('.',$name))); } ?>