<?php
function cstr_liste($ch,$type="") {
  $handle=@opendir("$ch");
  $nom_complet='';
 $cpt=0;
 while ($file = @readdir($handle)) {
  if  ($file != "." && $file != ".."){
	 if (empty($type))$nom_complet[$cpt]=$file;
	else {
		if (eregi(".*(\.$type)",$file)) $nom_complet[$cpt]=$file;
	}
    $cpt++;
    }
   }
  @closedir($handle);
  return $nom_complet;
 }
?>