## ## @website http://www.tildemark.com ## ## @revision 1 ## ############################################################################## function getExcerpt($content) { $text = html_entity_decode($content); $excerpt = array(); //match all tags preg_match_all("|<[^>]+>(.*)[^>]+>|", $text, $p, PREG_PATTERN_ORDER); for ($x = 0; $x < sizeof($p[0]); $x++) { //match tags containing "
" if (preg_match('
i', $p[0][$x])) {
$strip = strip_tags($p[0][$x]);
if (preg_match("/\./", $strip))
$excerpt[] = $strip;
}
if (isset($excerpt[0])){
preg_match("/([^.]+.)/", $strip,$matches);
return $matches[1];
}
}
return false;
}
function getMetaTitle($content){
$pattern = "|<[\s]*title[\s]*>([^<]+)<[\s]*/[\s]*title[\s]*>|Ui";
if(preg_match($pattern, $content, $match))
return $match[1];
else
return false;
}
function getMetaDescription($content) {
$metaDescription = false;
$metaDescriptionPatterns = array("/
";
print "description: $description ";
print "
";
print "excerpt: $excerpt";
?>