方法一:
使用php自帶的一個函數:html_entity_decode();
具體使用舉例:
html頁面的代碼:
$str='<strong style="box-sizing: border-box; margin: 0px; padding: 0px; border: 0px; outline: 0px; font-size: 14px; vertical-align:baseline;font-weight: 700; background: transparent;">{$res}</strong>';
php端的代碼:
- $str = 'Epoxy Technology, Inc.';
- $res = html_entity_decode($str);
以上代碼html瀏覽器打開如下:Epoxy Technology, Inc.
方法二:(簡單直接)
講帶標籤的數據assign到html頁面,在讀取該數據的時候在後面加上 |html_entity_decode=###
舉例:
{$districtlist.catedetail|html_entity_decode=###}