Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

 
Reply to this topicStart new topic
> Usuwanie folderu
barkroli
post 10.03.2005, 13:17:15
Post #1





Grupa: Zarejestrowani
Postów: 79
Pomógł: 0
Dołączył: 23.05.2004

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


Jak usunąć folder najlepiej odrazu cały z zawartością lub pusty jeśli nie ma polecenia takiego questionmark.gif


--------------------
Systemy dedykowane, Magento, Typo3
PascalSystem.pl
Go to the top of the page
+Quote Post
Darti
post 10.03.2005, 13:22:20
Post #2





Grupa: Zarejestrowani
Postów: 1 076
Pomógł: 62
Dołączył: 6.03.2005
Skąd: Wroc

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


do pustych katalogów:
bool rmdir ( string dirname [, resource context] )

a do niepustych funkcja:
  1. <?php
  2. function deldir($dir) {
  3. $dh=opendir($dir);
  4. while ($file=readdir($dh)) {
  5. if($file!=&#092;".\" && $file!=\"..\") {
  6. $fullpath=$dir.&#092;"/\".$file;
  7. if(!is_dir($fullpath)) {
  8. unlink($fullpath);
  9. } else {
  10. deldir($fullpath);
  11. }
  12. }
  13. }
  14. closedir($dh);
  15.  
  16. if(rmdir($dir)) {
  17. return true;
  18. } else {
  19. return false;
  20. }
  21. }
  22.  
  23. ?>


ps - obie informacje zaczęrpnięte z MANUALA

Ten post edytował Darti 10.03.2005, 13:24:25


--------------------
The answer is out there, Neo. It's looking for you. And it will find you, if you want it to.
SERVER_SOFTWARE : Apache/2.2.4 (Win32) PHP/5.2.1
MySQL Client API version : 5.0.27
Go to the top of the page
+Quote Post

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 Wersja Lo-Fi Aktualny czas: 14.08.2025 - 12:46