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 91 views
1 answer 277 views
1 answer 350 views
2 answers 1,070 views
3 answers 417 views
1 answer 178 views
3 answers 424 views
...