Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

 
Reply to this topicStart new topic
> Listing katalogów, Funkcja, PHP 4 i 5
GrayHat
post 1.12.2004, 19:44:38
Post #1





Grupa: Zarejestrowani
Postów: 566
Pomógł: 18
Dołączył: 23.08.2003
Skąd: Łomża

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


  1. <?php
  2.  
  3. function listing($dir) {
  4.  $directories = array();
  5.  if ($data = opendir($dir)) {
  6.  while ($test = readdir($data)) {
  7. if (filetype($dir.$test)==&#092;"dir\" && $test != \".\" && $test != \"..\") {
  8.  $directories[] = $test; 
  9. }
  10. }
  11. closedir($data);
  12. }
  13. return $directories;
  14. }
  15. ?>


Ten post edytował GrayHat 1.12.2004, 23:04:03


--------------------
*Note: No animals were killed durning the construction of this post.
Go to the top of the page
+Quote Post
hwao
post 1.12.2004, 21:25:53
Post #2


Developer


Grupa: Moderatorzy
Postów: 2 844
Pomógł: 20
Dołączył: 25.11.2003
Skąd: Olkusz




Napisz jak tej funckji uzywac czyli
co zwraca NazwaFunckju( parametry )
Go to the top of the page
+Quote Post
GrayHat
post 1.12.2004, 22:04:15
Post #3





Grupa: Zarejestrowani
Postów: 566
Pomógł: 18
Dołączył: 23.08.2003
Skąd: Łomża

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


uzycie:

  1. <?php
  2.  
  3. var_export(listing(&#092;"/home/\"));
  4.  
  5. ?>


funkcja zwraca tablice


--------------------
*Note: No animals were killed durning the construction of this post.
Go to the top of the page
+Quote Post

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: 8.06.2024 - 06:04