[英]PHP htmlentities() and htmlspecialchars() are broken / do not work
我過去曾經使用過這兩個功能,但它們運行良好。 我正在開發CakePHP應用程序,由於某種原因,使用這兩個功能都沒有。 我已經設置了一個簡單的測試,但我不敢相信它返回了true:
$loc_title = htmlentities($location['locations']['title']);
if(htmlentities($location['locations']['title']) === $location['locations']['title']){
echo "htmlentaties is broken.";
}
是什么導致這些功能無法正常工作?
考慮改變
htmlentities($location['locations']['title'] === $location['locations']['title'])
至
htmlentities($location['locations']['title']) === $location['locations']['title']
例如 ;-)
Beause您在這里所做的是將標題與其自身進行比較的結果是逃避了實體。 最有可能評估為真。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.