Hi. Actually...
PHP Code:
//extracts title
if ( eregi("<title *>([^<>]*)</title *>",$text,$regs) ) {
$title = trim($regs[1]);
}
else {
$title = "";
}
The one you posted is meant to never display the filename as the title in search results, a tiny change for another member who wanted "Untitled" instead of the filename for non-titled pages.