Quote Originariamente inviata da aquatimer2000 Visualizza il messaggio
Ciao a tutti, per il mio sito vorrei avere una lista di tutti i file, dalla cartella httpdocs e via via in essi contenuti, compresi quelli che stanno in cartelle e sottocartelle..

ci sono delle classi o script di esempio da prendere in considerazione ?

Grazie a tutti per l'aiuto!
ciao!

si chiama ricorsione.
ti ho fatto un esempio volante (che sicuramente può essere migliorato).
nella cartella di inizio ho:
- una sotto cartella con alcun file dentro
- due file "sciolti"

questo l'esempio:
Codice PHP:
<?php

function getFiles($directory) {
    
$iterator = new DirectoryIterator($directory);
    foreach (
$iterator as $file) {
        if (
$file->getFilename() !== '.' && $file->getFilename() !== '..') {
            if (
$file->isDir()) {
                
getFiles($file->getPathname());
            } else {
                echo 
$file->getRealPath() . ' - ' $file->getFilename() . '<br>';
            }
        }
    }
}

$directory './geocomplete';
getFiles($directory);
e questo il risultato:
codice:
/var/www/geocomplete/examples/map.html - map.html
/var/www/geocomplete/examples/styled.html - styled.html
/var/www/geocomplete/examples/simple.html - simple.html
/var/www/geocomplete/examples/multiple_fields.html - multiple_fields.html
/var/www/geocomplete/examples/multiple_results.html - multiple_results.html
/var/www/geocomplete/examples/logger.js - logger.js
/var/www/geocomplete/examples/location.html - location.html
/var/www/geocomplete/examples/styles.css - styles.css
/var/www/geocomplete/examples/bounds.html - bounds.html
/var/www/geocomplete/examples/custom_attribute.html - custom_attribute.html
/var/www/geocomplete/examples/country_limit.html - country_limit.html
/var/www/geocomplete/examples/api.html - api.html
/var/www/geocomplete/examples/blur.html - blur.html
/var/www/geocomplete/examples/form.html - form.html
/var/www/geocomplete/examples/draggable.html - draggable.html
/var/www/geocomplete/index.html - index.html
/var/www/geocomplete/jquery.geocomplete.min.js - jquery.geocomplete.min.js
DirectoryIterator fa parte della Standard PHP Library.
dagli un'occhiata, ha parecchie cose utili!