WebsiteParser::getTitle( boolean $grab = false )

Extract title from grabbed contents

Description

Parameters

$grab

(boolean) (Optional) , flag to perform real time grab or use class content

Default value: false

Return

(array,) an array of extracted metatags

Source

File: bp-activity/vendors/website-parser/website_parser.php

    public function getTitle($grab = false)
    {
        $title = '';

        if ($grab)
            $this->grabContent();

        if (!is_null($this->content)) {

            preg_match($this->title_expression, $this->content, $match_title);
            $title = empty($match_title[1]) ? '' : $match_title[1];

        }

        return $title;
    }

Questions?

We're always happy to help with code or other questions you might have! Search our developer docs, contact support, or connect with our sales team.