repertoire_path.$expl->explnum_path); if($expl->repertoire_utf8) $path = utf8_encode($path); if($expl->ext) $file = substr($expl->nom,0,strpos($expl->nom,".")); else $file = $expl->nom; $exist = false; $i=0; while(!$exist){ $i++; $filename = ($i ? $file."_".$i : $file).($expl->ext ? ".".$expl->ext : ""); if(!file_exists($path.$filename)){ print $filename; $exist = true; } } } else print "0"; } else print "0"; } ?>