вот класс чтения файлов
Код: Выделить всё
class op_file
{
var $filename='';
var $rej=''; //Mode of reading
var $id_file='';
var $out='';
function __construct($filename,$rej)
{
$this->filename = $filename;
$this->rej = $rej;
$this->id_file = fopen($this->filename,$this->rej);
$this->out = $out;
}
function output_file()
{
while (!feof($this->id_file))
{
$this->out = fgets($this->id_file,255);
}
return $this->out;
}
function __destruct()
{
fclose($this->id_file);
}
}
$conten = new op_file('model.txt',r);
echo $conten->output_file();