title: Php scandir() problems
body: <p>I was wondering, my Scandir() function works on a php $_GET variable, so the variable returns the folder, but I'm having a problem because I'm not sure how to echo out an error if there is a problem with with directory.</p>
  
  <p>this is the error I am getting:</p>
  
  <pre><code>Warning: scandir(users/ro/f) [function.scandir]: failed to open dir: No such file or directory in C:\xampp\htdocs\OSO\desktop\main_content\file.php on line 31
  </code></pre>
  
  <p>This is my code</p>
  
  <pre><code>$folder = $_GET['file_folder'];
  $directory = "users/$username/$folder";
  if (scandir($directory, 0)) {
      unset($documents[0], $documents[1]);
      $documents = scandir($directory, 0);
  
      // for each loop
  } else {
      echo "No such directory";
  }
  </code></pre>
  
  <p>Cheers in advance</p>