title: PHP cannot delete directory
body: <p>I am trying to delete a folder with files inside of it but the following code does delete the files, but not the folder.</p>
  
  <pre><code>$nameFolder = $_GET['delete'];
  $dir = '../projecten/projecten/'.$nameFolder.'';
  $filesIN = glob($dir."/"."*");
  $status = 'false';
  
  foreach($filesIN as $files) //here i take all the files
      unlink($files);
  
  $status = 'true';
  if($status=='true'){
      rmdir($dir);
      $status = 'false';
  }
  </code></pre>