2
我怎麼能substr
一個文本執行htmlspecialchars
它。如何設置特殊字符的substr?
保存在數據庫
some text " some text " some text
' some text ' some text 'some text' some text '
some text 'some text ' some text ' some text '
與用htmlspecialchars(我想substr
從此文本)
some text " some text " some text ' some text ' some text ' some text '
some text ' some text ' some text ' some text ' some text '
當SUBSTR:
some text " some text " some text ' some text �
坦克
UPDATE
我用這個
if(strlen($text)>100){
$s = html_entity_decode($text);
$shorten = substr($s,0,50);
echo htmlentities($shorten);
}
,只是改變"
您是否嘗試過用特殊字符字符串解碼? – chility 2015-02-07 20:33:21
是的,我做了,但沒有工作 – Simon 2015-02-07 20:35:55
然後,我認爲你需要向我們展示代碼,告訴我們發生了什麼以及你想要發生什麼_exactly。 – MAV 2015-02-07 20:38:21