Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $current_dir = "$DOCUMENT_ROOT"."eventi/";
- $dir = opendir($current_dir);
- while ($file = readdir($dir)){
- $parts = explode(".", $file);
- if (is_array($parts) && count($parts) > 1) {
- $extension = end($parts);
- if ($extension == "php" OR $extension == "PHP"){
- $pat = array();
- $rep = array();
- $pat[0] = '/-/';
- $pat[1] = '/.php/';
- $rep[0] = ' ';
- $rep[1] = '';
- $cleanfile = preg_replace($pat,$rep,$file);
- echo "<a href=\"eventi/$file\" target=\"_self\" class=\"box_evento_title\"> $cleanfile </a><br />";
- }
- }
- }
- closedir($dir);
- ?>
Add Comment
Please, Sign In to add comment