file="lwat_alumnos"; break; case "Profesores": $this->file="lwat_profesores"; break; case "Otros": $this->file="lwat_otros"; break; default: $file="lwat_otros"; } $this->f = fopen($this->path.'/'.$this->file,"a+"); } function write($string){ fwrite($this->f,$string); } function __destruct(){ fclose($this->f); } /** * Clear file * * @param $file string * @return void */ function cleanfile() { fclose($this->f); $abrir = fopen($this->path.'/'.$this->file , "w"); fclose($abrir); $this->f = fopen($this->path.'/'.$this->file,"a+"); } } ?>