<? php
class GestioneFile{
public $testo="";
public $cercatesto="";
public $file="";
public function GestionFile($t,$ct){
$this->testo=$t;
$this->cercatesto=$ct;
$this->file="";
}
public function ApriFile(){
$this->file=fopen("testo.txt",a+);
}
public function ScriviFile($this->testo){
fwrite($this->file,$this->testo);
}
public function CercaTesto($this->cercatesto){
$pos = strpos($this->file, $this->cercatesto);
if ($pos)
echo "Trovato!";
else
echo "Non trovato!";
}
public function ChiudiFile(){
fclose($this->file);
}
}
?>