Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [PHP]usuwanie katalogu wraz z plikami, nieaktualne - juz mniej wiecej działa
glasswalker
post
Post #1





Grupa: Zarejestrowani
Postów: 18
Pomógł: 0
Dołączył: 21.11.2008

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


Już po poprawieniu - czyli na razie działa jak powinien.
CODE
  1. <?php
  2. function delDir($dir)
  3. {
  4. if(!$fd=opendir($dir))
  5. {
  6. return false;
  7. }
  8. else
  9. {
  10. while(($file=readdir($fd))!==false)
  11. {
  12. if($file=="."||$file=="..") continue;
  13. if((is_dir("$dir/$file")))
  14. {
  15. delDir("$dir/$file");
  16. rmdir("$dir/$file");
  17. }
  18. else if(is_file("$dir/$file"))
  19. {
  20. unlink("$dir/$file");
  21. }
  22. }
  23. closedir($fd);
  24. }
  25. }
  26. delDir("ppp1");
  27. ?>


Ten post edytował glasswalker 11.09.2009, 13:03:01
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: 20.08.2025 - 00:06