1 parent
bef34c6764
commit
4b0d1ee8a4
29 files changed
+4660
-3
No files matched your search
Executable
+21
@@ -0,0 +1,21 @@
|
||||
<?php
|
||||
// Pega todos os arquivos .txt no diretório atual
|
||||
$files = glob('*.txt');
|
||||
|
||||
// Inicia a lista não ordenada
|
||||
echo "<ul>";
|
||||
|
||||
foreach ($files as $file) {
|
||||
// Remove a extensão .txt do nome do arquivo
|
||||
$filenameWithoutExtension = basename($file, '.txt');
|
||||
|
||||
// Cria o link com o nome do arquivo na query string
|
||||
$link = "list_files.php?filetype=" . urlencode($filenameWithoutExtension);
|
||||
|
||||
// Cria o item da lista com o link
|
||||
echo "<li><a href=\"$link\">$filenameWithoutExtension</a></li>";
|
||||
}
|
||||
|
||||
// Fecha a lista não ordenada
|
||||
echo "</ul>";
|
||||
?>
|
||||
Reference in new issue
Block a user