Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> Wyświetlanie plików z katalogu..., tylko z wybranym rozszeżeniem :P
Lars
post
Post #1





Grupa: Zarejestrowani
Postów: 279
Pomógł: 15
Dołączył: 29.04.2005
Skąd: Gdynia

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


Mam skrypt:

  1. <?php
  2. $the_array=array();
  3. $handle=opendir($downloaddir);
  4. while(false !==($file=readdir($handle))) {
  5. if($file != '.' && $file !='..') {
  6. $the_array[]=$file;
  7. }
  8. }
  9. closedir($handle);
  10. sort($the_array);
  11. reset($the_array);
  12. while(list($key, $val)=each($the_array)) {
  13. echo '<a href=\"'.$downloaddir.'/'.$val.'\">'.$val.'</a>';
  14. }
  15. ?>


chce, aby wyświetlał tylko pliki z rozszeżeniem *.zip.
Jak to zrobić questionmark.gif happy.gif

Ten post edytował Lars 5.07.2005, 18:36:51


--------------------
(\.../) This is Bunny. Copy and paste bunny into
(O.o) your signature to help him gain world domination.
(> <) Zanim zapytasz | Też się przyda | Pomogłem ci? Kliknij "Pomógł"
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 Aktualny czas: 21.08.2025 - 18:40