<?php
class Myclass {
public $fullText='';
public function SayHello($text) {
echo 'i,'.__CLASS__.'.I say '.$text.'';
}
/////////////////////////////////
public function ReadFile() {
if (fopen("readit.txt", "r"))
{
while (!feof(fopen("readIt.txt", "r")))
{
$this->fullText .= fgets(fopen("readIt.txt", "r"), 999);
}
}
return $this->fullText;
}
/////////////////////////////////
}
$first = new Myclass;
echo $first->ReadFile();
?>
public function ReadFile() {
if($f = fopen("readit.txt", "r")) {
$this->fullText = fread($f, filesize("readit.txt"));
}
fclose($f);
return $this->fullText;
}
public function ReadFile() {
return file_get_contents("readit.txt");
}