Skip to content

Instantly share code, notes, and snippets.

@juananruiz
Created January 21, 2014 11:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save juananruiz/8538590 to your computer and use it in GitHub Desktop.
Save juananruiz/8538590 to your computer and use it in GitHub Desktop.
PHP: Buscar los archivos contenidos en un directorio
<?php
$ruta_completa = CC_DIR_BASE . 'public/upload/recurso/' . $id;
if (is_dir($ruta_completa))
{
$directorio = opendir($ruta_completa);
while ($archivo = readdir($directorio))
{
$fecha = date ("d-m-Y", filemtime($ruta_completa . "/" . $archivo));
$archivos[] = array($archivo, $fecha);
}
closedir($directorio);
$smarty->assign('archivos',$archivos);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment