Imdb\Title::seasons PHP Метод

seasons() публичный Метод

Get the number of seasons or 0 if not a series
См. также: IMDB page / (TitlePage)
public seasons ( ) : integer
Результат integer seasons number of seasons
    public function seasons()
    {
        if ($this->seasoncount == -1) {
            $this->getPage("Title");
            if (preg_match_all('|href="/title/tt\\d{7}/episodes\\?season=\\d+.*?"\\s*>(\\d+)</a>|Ui', $this->page["Title"], $matches)) {
                $this->seasoncount = $matches[1][0];
            } else {
                $this->seasoncount = 0;
            }
            if (preg_match_all('|href="/title/tt\\d{7}/episodes\\?season\\=unknown"\\s*>unknown</a>|Ui', $this->page["Title"], $matches)) {
                $this->seasoncount += count($matches[0]);
            }
        }
        return $this->seasoncount;
    }