Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [PHP]nazwy bez spacji
tomek34
post
Post #1





Grupa: Zarejestrowani
Postów: 26
Pomógł: 0
Dołączył: 28.04.2009

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


Witam!
Jak mogę wyświetlić zawartość foldelu z pominięciem plików ze spacjami w nazwie?
Plik któy wyświetla mi obecnie zawartość wygląda następująco:

  1. <?php
  2.                  $dir = "D:sermoidane";
  3.                  function printDir($dir)
  4.                  {
  5.                    $fd = opendir($dir);
  6.                      if(!$fd) return false;
  7.                        while (($file = readdir($fd)) !== false){
  8.                      if($file != "." && $file != ".."){
  9.                      echo("<a href=\"download.php?name=");
  10.                      echo("$file\" class='style3'>$file</a><br />");
  11.                      }
  12.                      }
  13.                      closedir($fd);
  14.                  }
  15.                  printDir($dir);
  16.             ?>



Pozdrawiam
Go to the top of the page
+Quote Post
 
Start new topic
Odpowiedzi
outsider
post
Post #2





Grupa: Zarejestrowani
Postów: 267
Pomógł: 36
Dołączył: 8.08.2008

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


  1. <?php
  2. $dir = "D:sermoidane";
  3.                 function printDir($dir)
  4.                 {
  5.                   $fd = opendir($dir);
  6.                     if(!$fd) return false;
  7.                       while (($file = readdir($fd)) !== false){
  8.                     $pos = strpos($file, ' ');
  9.                     if($file != "." && $file != ".." && $pos !== false){
  10.                     echo("<a href=\"download.php?name=");
  11.                     echo("$file\" class='style3'>$file</a><br />");
  12.                     }
  13.                     }
  14.                     closedir($fd);
  15.                 }
  16.                 printDir($dir);
  17. ?>


Ten post edytował *OuTSideR* 1.05.2009, 17:32:46
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: 3.10.2025 - 06:58