Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [php] Listing plików w katalogu i podkatalogach
rafaelb
post
Post #1





Grupa: Zarejestrowani
Postów: 49
Pomógł: 2
Dołączył: 17.01.2004

Ostrzeżenie: (0%)
-----


Listing w jednym katalogu bez problemu

Mam problem w podkatalogami , usiłuje rekurencyjnie ale jakoś pod górkę idzie. Może ktoś może pomóc?
  1. <?php
  2. $path = '../test/';
  3. printFileInDir($path);
  4.  
  5. function printFileInDir($path){
  6. print '#'.$path.'#<br/>';
  7. if ($handle = opendir($path))
  8. {
  9. while (false !== ($file = readdir($handle)))
  10. {
  11. if ($file<>"." and $file<>"..")
  12. if (is_readable($path.$file))
  13. if(is_dir($path.$file))
  14. {
  15. print '<b>Katalog '.$file.'</b><br/>';
  16. //printFileInDir($path.$file); // poprawiłem tutaj i i działa
  17. printFileInDir($path.$file.'/');
  18. }
  19. else print $file.'<br/>';
  20.  
  21. }
  22. closedir($handle); 
  23. }
  24. }
  25. ?>


ale teraz mam pytanie jak posortować listing?

Ten post edytował rafaelb 27.06.2007, 09:22:48
Go to the top of the page
+Quote Post

Posty w temacie


Reply to this topicStart new topic
1 Użytkowników czyta ten temat (1 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Aktualny czas: 22.08.2025 - 04:10