How to get (extract) the <title> from HTML page in PHP

1 Answer

0 votes
        $title = "";
        $match = array();
        if (preg_match('/<title>(.*?)<\/title>/', $html, $match)) 
            $title =  $match[1];

 



answered Nov 3, 2016 by avibootz

Related questions

1 answer 80 views
1 answer 262 views
1 answer 326 views
2 answers 1,042 views
3 answers 384 views
1 answer 171 views
3 answers 404 views
...