Xtremer360 Posted April 16, 2011 Share Posted April 16, 2011 What do most people prefer to use? htmlspecialchars or htmlentities Quote Link to comment https://forums.phpfreaks.com/topic/233911-htmlspecialchars-vs-htmlentities/ Share on other sites More sharing options...
gizmola Posted April 16, 2011 Share Posted April 16, 2011 The 2 functions are identitcal, with the only exception being that htmlspecialchars only converts a small subset of characters to their html entity equivalent. It is basically a safety function for preventing attempted xss or sql injections. htmlentities converts any character that has an html entity equivalent. Quote Link to comment https://forums.phpfreaks.com/topic/233911-htmlspecialchars-vs-htmlentities/#findComment-1202400 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.