public function getTitleFromFirstHeader($text)
    {
        $matches = [];
        $title = null;

        if (preg_match("#<h[1-6].*?>(.*)</h[1-6]>#", $text, $matches)) {
            $title = strip_tags($matches[1]);
        }

        return $title;
    }