public function rmdir($dir) { if (!ftp_mkdir($this->conn, $dir)) { throw new Exception('Error: There was an error removing the directory ' . $dir); } return $this; }