tazza di caffé

List and link files

in a folder (and subfolders)

icona per espandere il menu interno
Table of Contents

il senso di questa funzionewhy it's useful

Se si aggiorna spesso il proprio sito, o almeno alcune sue cartelle (directory), può essere utile automatizzare la creazione del menu con i files contenuti, ovviamente linkati e non semplicemente elencati, e meglio se in un formato che gradevole e comprensibile ai visitatori. In questo modo si evitano i broken linksIf you update your site often, or at least some of its directories, it may be useful to automate the creation of the menu with the files contained, obviously linked and not simply listed, and obviously in a format that is pleasant and understandable to visitors. In this way you can easily avoid broken links.

Per fare questo esistono degli script, tra cui in PHP, con cui si posso appunto raggiungere tali obbiettivi To do this there are several scripts, including in PHP, with which you can achieve these goals:

  • elencando soltanto i files e non le cartelle o i link per risalire di (un) livello (cioè . e ..)listing only the files and not the folders or links to go up (a) level (i.e. . and ..),
  • elencando soltanto i files che ci interessa siano linkati, ad esempio non il file indexlisting only the files that we are interested in are linked, for example not the index file,
  • nascondendo le estensionihiding extensions,
  • eventualmente sostituendo nomi abbreviati con nomi completipossibly replacing abbreviated names with full names.

Do, qui sotto, un esempioHere an example


In questo caso non ci siamo preoccupati di sostituire i nomi dei files con dei nomi pienamente comprensibili, e l'effetto, ne converrete, non è ottimaleIn this case we have not bothered to replace the names of the files with fully understandable names, and the effect, you will agree, is not optimal 🙂.

📂 In questa sezioneIn this section

  • List and link files, in a folder (and subfolders): come creare un elenco automaticamente aggiornabile dei files php in una cartella di un sito webhow to get a list of linked files in a given website folder
  • Automatic webpage TOC, from header tags: it is possibile to get an automatic index (TOC, table of contents) of a webpage
  • Redirect by language, in a multilingual website: come reindirizzare i visitatori in base alla loro linguaredirect website visitors according to their language