To create manupulate using HTML, you can use the Document Object Model (this is the recommended way).
If you are looking for a dirty quick fix, this is a pretty simple expression:
$html = file_get_contents('http://example.com'); $matches = preg_match("/<title>([^<]*)<\/title>/im"); echo $matches[1];
source share