Hiding Files

Started on the old forum in February 2008 · view the original in the archive · old links redirect here

2 replies · 665 views · started 18 years ago · 1 min read

modfiles Developer · 200 posts #1

How can i hide a certain file in a directory listing? lets say, i dont want to see in the list the php.ini file?

Guest #2

/// This will show all the files in a directory except php.ini

$file = '';
   if ($opd = opendir("directory/"))
   {
      while (false !== ($file = readdir($opd)))
      {
         if($file != 'php.ini')
         {
            
               echo "$file'';
         }
      }
      closedir($opd);
   }

Sign in to reply.

Similar topics

Keyboard shortcuts

g f
Go to forums
g h
Go to your feed
g m
Go to messages
r
Reply (in a topic)
/
Search
j
Next post
k
Previous post
?
This list
Ctrl/⌘ + Enter
Send what you are writing
Ctrl/⌘ + B / I
Bold / italic while writing
Esc
Close