Afficher Arborescence d'un site

Par Cobryn, il y a 10 ans


Bonsoir,
Je voulais savoir comment faire pour montrez l'arborescence d'un site web en php, du style:
echo arbo();

Quelques choses qui retrace l'arborescence d'un site.
Merci

4 réponses

Cobryn, il y a 10 ans

Résolue:

<?php function mkmap($dir){ echo "<ul>"; $folder = opendir ($dir); while ($file = readdir ($folder)) { if ($file != "." && $file != "..") { $pathfile = $dir.'/'.$file; echo "<li><a href=$pathfile>$file</a></li>"; if(filetype($pathfile) == 'dir'){ mkmap($pathfile); } } } closedir ($folder); echo "</ul>"; } ?> <?php mkmap('.'); ?>
Huggy, il y a 10 ans

tu redéveloppes la commande tree ?

Huggy, il y a 10 ans

Oui c'est une commande
mais on peut la lancer depuis php

$result = shell_exec("tree"); echo mb_convert_encoding($result, "UTF-8", "CP850");
Huggy, il y a 10 ans

Si tu le dis ....