daily pastebin goal
20%
SHARE
TWEET

[PHP]: Listar diretório com link e excessão.

garfield Nov 5th, 2011 114 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. /*=================================================================
  2.          _ ____         _____             __
  3.         (_)  _ \ ___  |_   _|__  __ _|  \/  |
  4.         | | |_) / __|   | |/ _ \/ _` | |\/| |
  5.         | |  __/\__ \   | |  __/ (_| | |  | |
  6.         |_|_|   |___/   |_|\___|\__,_|_|  |_|
  7.  
  8.             Criado Por SuYaNw Dácio
  9.             www.ips-team.blogspot.com
  10.    
  11. =================================================================*/
  12.  
  13. function ShowDirectory($dir = ".", $Ex = "")
  14. {
  15.         $dir = opendir('.');
  16.     while (false !== ($file = readdir($dir)))
  17.                 if(strstr($file, $Ex))
  18.                         echo "<a href='$file'>$file</a><br>";
  19.     closedir($dir);
  20. }
  21.  
  22.  
  23. // Exemplo de uso.
  24.  
  25. ShowDirectory(".", ".txt"); // Exibe somente os arquivos arquivos de textos
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top