manalnor Posted October 30, 2011 Share Posted October 30, 2011 Hello dears, I've tried to use htmlspecialchars or htmlentities but both no longer work ! Example1 : <?php $new = htmlspecialchars("<a href='test'>Test</a>", ENT_QUOTES); echo $new; ?> Output should <a href='test'>Test</a> <?php $str = "A 'quote' is <b>bold</b>"; echo htmlentities($str); ?> Output should A 'quote' is <b>bold</b> But it isn't working ? what is wrong ? Quote Link to comment https://forums.phpfreaks.com/topic/250113-what-is-wrong-with-htmlspecialchars-not-working/ Share on other sites More sharing options...
PFMaBiSmAd Posted October 30, 2011 Share Posted October 30, 2011 Did you do a 'view source' of the page in your browser? Quote Link to comment https://forums.phpfreaks.com/topic/250113-what-is-wrong-with-htmlspecialchars-not-working/#findComment-1283455 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.