Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> Sprawdzanie Czy Katalog Jest Pusty
Cyberbo
post
Post #1





Grupa: Zarejestrowani
Postów: 22
Pomógł: 0
Dołączył: 26.01.2003

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


no wlasnie... jak sprawdzic czy dany katalog jest pusty... czy mozna go usunac... (IMG:http://forum.php.pl/style_emoticons/default/questionmark.gif)
Go to the top of the page
+Quote Post
 
Start new topic
Odpowiedzi
mike
post
Post #2





Grupa: Przyjaciele php.pl
Postów: 7 494
Pomógł: 302
Dołączył: 31.03.2004

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


  1. <?php
  2. $resDir = opendir($strDir);
  3. while( $strFile = readdir( $resDir ) )
  4. {
  5.     $arrFiles[] = $strFile;
  6. }
  7. if( sizeof( $arrFiles ) <= 2 )
  8. {
  9.     echo 'katalog jest pusty';
  10.     rmdir($strDir) //USUWANIE KATALOGU
  11. }
  12. else
  13. {
  14.     echo 'katalog nie jest pusty';
  15. }
  16. ?>
Go to the top of the page
+Quote Post

Posty w temacie


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

 



RSS Aktualny czas: 17.10.2025 - 17:00