uDesign
  1. // glob() orqali hostindan .php fayllarni qidiramiz!
  2.  
  3.  
  4. $files = glob('*.php');
  5. print_r($files);
  6.  
  7. /* rezultat
  8. Array
  9. (
  10.   [0] => test.php
  11.   [1] => index.php
  12.   [2] => post.php
  13.   [3] => reg.php
  14. )
  15. */
  16.  
  17.  
  18. ///// Bu yerdayam hudi tepadagidek faqat .php va txt fotmatdagi fayllarni topadi
  19. $files = glob('*.{php,txt}', GLOB_BRACE);
  20.  
  21. print_r($files);
  22. /* rezultat
  23. Array
  24. (
  25.   [0] => test.php
  26.   [1] => index.php
  27.   [2] => reg.php
  28.   [3] => test.php
  29.   [4] => log.txt
  30.   [5] => test.txt
  31. )
  32. */