title: PHP read sub-directories and loop through files how to?
body: <p>I need to create a loop through all files in subdirectories. Can you please help me struct my code like this:</p>
  
  <pre><code>$main = "MainDirectory";
  loop through sub-directories {
      loop through filels in each sub-directory {
          do something with each file
      }
  };
  </code></pre>