Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [php] is_dir
camikazee
post
Post #1





Grupa: Zarejestrowani
Postów: 171
Pomógł: 18
Dołączył: 17.04.2006
Skąd: Bydgoszcz

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


Witam!

Nie moge dojsc do tego dlaczego nawet gdy w strukturze katalogu jest inny katalog, to skrypt traktuje go jako plik :/

  1. <?php
  2. while( false !== ( $FileTemp = readdir( $this->dirHandle ) ) ) {
  3. if ( $FileTemp != '.' && $FileTemp != '..' ) {
  4. if (is_dir($FileTemp)) {
  5. $this->FileName = $FileTemp;
  6. $this->FileType = '<DIR>';
  7. }
  8. else {
  9. $FileNameTable = explode(".", $FileTemp);
  10. $this->FileName = $FileNameTable[0];
  11. $this->FileType = $FileNameTable[1];
  12. }
  13.  
  14. $FileHandle = fopen($this->DirSource."/".$FileTemp, 'r');
  15. $FileStats = fstat($FileHandle);
  16. $this->FileSize = round(($FileStats[size])/1024, 2);
  17. $this->FileData = date("d.m.Y H:i", $FileStats[mtime]);
  18. $this->FileList[$i][name] = $this->FileName;
  19. $this->FileList[$i][type] = $this->FileType;
  20. $this->FileList[$i][size] = $this->FileSize;
  21. $this->FileList[$i][date] = $this->FileData;
  22. $i++;
  23. fclose($FileHandle);
  24. }
  25. }
  26. ?>
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: 24.08.2025 - 16:06