Visa ett inlägg
Oläst 2010-06-01, 09:29 #3
robincox robincox är inte uppkopplad
Flitig postare
 
Reg.datum: Aug 2008
Inlägg: 301
robincox robincox är inte uppkopplad
Flitig postare
 
Reg.datum: Aug 2008
Inlägg: 301
lägg till striptags() på $text i början av funktionen så har du fortfarande en kort funktion men som även tar bort bilder, html, javascript mm.

function excerpt($text, $maxchars) {
$text = strip_tags($text);
$text = substr($text, 0, $maxchars);
$position = strrpos($text, ' ');

if($position > 0){
$text = substr($text, 0, $position);
}

return $text;
}
robincox är inte uppkopplad   Svara med citatSvara med citat