title: Foreach loop to loop for each file in a directory not working
body: <p>I am making a foreach loop to run some code for each file in the directory. Can someone help me debug this loop? Problem is: I always get a warning causing this loop not to work. </p>
  
  <p>This is my code:</p>
  
  <pre><code>$files = glob("data/*.txt");
  foreach($files as $file) {
      $data = file_get_contents($file);
  }
  </code></pre>