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 185 views
1 answer 396 views
1 answer 451 views
2 answers 1,199 views
3 answers 593 views
1 answer 284 views
...