/ Published in: PHP
Use this snippet to get a page title using the DOM.
Expand |
Embed | Plain Text
function get_remotetitle($urlpage) { $dom = new DOMDocument(); if($dom->loadHTMLFile($urlpage)) { $list = $dom->getElementsByTagName("title"); if ($list->length > 0) { return $list->item(0)->textContent; } } }
You need to login to post a comment.
