Hi there DPers, Need some help with parsing HTML documents using PHP. I have tried this one: (regexp) if (eregi("<title>(.*)</title>", $val, $title)) { $page_title = $title[1]; $is_title = true; } Code (markup): but it's not working when parsing titles such as this one: <title> Some Page Title Here </title> Code (markup): By not working I mean that I cannot get the text "Some Page Title here". The parser breaks the HTML down line by line. Any other approach to this? Any help would be much appreciated.
if (preg_match_all("#<title>(.*?)</title>#si", $val, $title)) { $page_title = $title[1][0]; $is_title = true; } PHP: Does this one work?