static function str2metadesc($txt) { $txt = str::condenseHtmlChars($txt, ' '); $txt = str::condenseTags($txt, ' '); $txt = str_replace(array('"', ' .'), array("'", '.'), $txt); $txt = trim(str::condenseWhitespace($txt)); if (strlen($txt) > 320) { $txt = substr($txt, 0, 317) . '...'; } return $txt; }