[英]PHP: htmlentities not working with variable
我正在使用htmlentities()將Ç和®之類的字符轉換為其字符代碼。 我正在從MYSQL數據庫獲取文本。
while($row = mysql_fetch_array($array, MYSQL_NUM)){
echo "<div style='float:left; margin-right:40px;'>
<div style='width:148px; height:141px; background-image:url(uploads/".$row[0].")'>
<img src='images/glasscase.png' alt=''/>
</div>
<font style='font-size:20px'>".htmlentities($row[1], ENT_QUOTES,"UTF-8")."</font>
<br/>
<font style='font-size:14px'>".htmlentities($row[2], ENT_QUOTES, "UTF-8")."</font>
</div>";
}
但是,當使用htmlentities()時,$ row [2]返回一個空字符串。 有誰知道怎么了?
謝謝!
您為什么不廢棄“ htmlentities”而只使用
htmlspecialchars();
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.