Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- require __DIR__ . '/classArticle.php';
- class News
- {
- protected $records;
- public function __construct($file)
- {
- $lines = file(__DIR__. $file);
- $this->records = [];
- foreach ($lines as $line) {
- $arr = explode('///', $line);
- $this->records[] = new Article($arr[0], $arr[1], $arr[2]);
- }
- }
- public function getNews()
- {
- return $this->records;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement