Advertisement
SashaRaaa

Untitled

Jul 17th, 2018
561
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. class GuestBook {
  2. public $text;
  3. protected $reviews = [];
  4.  
  5. public function __construct ($file) {
  6. $file = fopen ( $file, 'r' );
  7. while ( !feof($file) ) {
  8. $line = fgets($file, 1024);
  9. this->reviews[ ] = $line;
  10. }
  11. }
  12.  
  13. public function getData() {
  14. $b = file ( __DIR__ . /guestbook.txt);
  15. return $b;
  16. }
  17.  
  18. public function append($text) {
  19. $c = fopen ( __DIR__ . /guestbook.txt, 'a');
  20. fwrite ( $c, $this->text );
  21. fclose ( $c );
  22. }
  23.  
  24. public function save() {
  25. }
  26.  
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement