forked from science-ation/science-ation
A few more common html entities to convert to text
This commit is contained in:
parent
df3cd54701
commit
617723cdbe
@ -1274,8 +1274,15 @@ function getTextFromHtml($html) {
|
||||
$text=eregi_replace('<br[[:space:]]*/?[[:space:]]*>',chr(13).chr(10),$text);
|
||||
//and strip the rest of the tags
|
||||
$text=strip_tags($text);
|
||||
//and replace
|
||||
|
||||
//a few common html entities
|
||||
//replace & with & first, so multiply-encoded entities will decode (like "&#160;")
|
||||
$text=str_replace("&","&",$text);
|
||||
$text=str_replace(" "," ",$text);
|
||||
$text=str_replace(" "," ",$text);
|
||||
$text=str_replace("<","<",$text);
|
||||
$text=str_replace(">",">",$text);
|
||||
|
||||
return $text;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user