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

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

Get movie main comment (from title page - split-up variant)
См. также: IMDB page / (TitlePage)
public comment_split ( ) : array
Результат array comment array[string title, string date, array author, string comment]; author: array[string url, string name]
    public function comment_split()
    {
        if (empty($this->split_comment)) {
            if ($this->main_comment == "") {
                $comm = $this->comment();
            }
            if (@preg_match('!<strong[^>]*>(.*?)</strong>.*?<div class="comment-meta">\\s*(.*?)\\s*\\|\\s*by\\s*(.*?</a>).*?(<p[^>]*>.*?)\\s*</div!ims', $this->main_comment, $match)) {
                @preg_match('!href="(.*?)">(.*)</a!i', $match[3], $author);
                $this->split_comment = array("title" => $match[1], "date" => $match[2], "author" => array("url" => $author[1], "name" => $author[2]), "comment" => trim($match[4]));
            } elseif (@preg_match('!<div class="comment-meta">\\s*<meta itemprop="datePublished" content=".+?">\\s*(.{10,20})\\s*\\|\\s*by\\s*(.*?)\\s*&ndash;.*?<div>\\s*(.*?)\\s*</div>!ims', $this->main_comment, $match)) {
                @preg_match('!href="(.*?)">(.*)</a!i', $match[2], $author);
                $this->split_comment = array('title' => '', 'date' => $match[1], 'author' => array("url" => $author[1], "name" => $author[2]), "comment" => trim($match[3]));
            }
        }
        return $this->split_comment;
    }