salve ragazzi,
ieri sera ho trovato uno script per leggere un file di testo fatto in una classe a oggetti.
Lo script legge tutto il file, ma il mio problema adesso è che vorrei estrarre da questo file esclusivamente un testo che si trova ad esempio tra i tag <h1></h1>.
questo è il mio codice di partenza:
Codice PHP:
class LeggiFile
{
private $resource;
private $fname;
function LeggiFile($nome)
{
$this->fname = $nome;
$this->resource = fopen($nome, 'r');
}
public function getContent()
{
return fread($this->resource, filesize($this->fname));
}
public function close()
{
fclose($this->resource);
}
}
Qualcuno mi può aiutare?