- substr: documentation ( source)
- stripos: documentation ( source)
<?php
$html = "some html
More
<Head>
Something
<title> Example.com</title>
<title> Example.com</title>
</Head>
Foo bar";
$pos = stripos($html, "<title>")+7;
echo substr($html, $pos, stripos($html, "</title>")-$pos);