- file_get_contents: documentation ( source)
- htmlentities: documentation ( source)
- preg_replace: documentation ( source)
<?php
$page = file_get_contents('http://google.com');
$title = preg_replace('/<title>(.*)</title>/i', '$1', $page);
echo htmlentities($title);