Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> Funkcja
xokisx
post 28.07.2008, 12:02:52
Post #1





Grupa: Zarejestrowani
Postów: 2
Pomógł: 0
Dołączył: 28.07.2008

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


Znalazłem w necie skrypt który wyświetla listy plików z określonego katalogu, oto ten skrypt:
Kod
<?php
  $i = 0;
  $images['file'] = "<img src=\"img/doc.gif\"> ";
  $images['dir'] = "<img align=\"center\" src=\"img/folder.gif\"> ";

  function show_dir($directory)
  {
      global $i, $images;

      $dir = opendir($directory);
      while ( $file = readdir($dir) )
      {
          if ( $file != "." && $file != ".." )
          {
              if ( is_dir($directory."/".$file) )
              {
                  echo ( str_repeat("&nbsp;", $i * 2) . $images['dir'] .  $file . "<br />" );
                  ++$i;
                  show_dir($directory . "/" . $file);
              }
              else
              {
                  echo ( str_repeat("&nbsp;", $i * 3) . $images['file'] . $file . "<br />" );
              }
          }
      }
      closedir($dir);
      --$i;
  }
  show_dir("./../../");
?>

Mógłby mi ktoś przerobić ten skrypt tak aby nie był w postaci funkcji a normalnego kodu ?
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 Wersja Lo-Fi Aktualny czas: 19.07.2025 - 04:35