code: static public function removeFiles($directory)
      {
          $scan = glob(rtrim($directory, '/') . '/*');
          foreach ($scan as $file) {
              if (is_file($file)) {
                  unlink($file);
              }
          }
  
          return true;
      }
docs: Remove all files from directory
  
  @param string $directory
  @return boolean