htmlspecialchars()
or htmlentities()
can be used to mask the user input, but which one is better for optimising search results? Will some search result be omitted because some characters are replaced?
Asked
Active
Viewed 461 times
0

jimmymcheung
- 87
- 7
-
Does this answer your question? [How to prevent XSS with HTML/PHP?](https://stackoverflow.com/questions/1996122/how-to-prevent-xss-with-html-php) – angel.bonev May 20 '22 at 12:47
-
Perhaps you want to check out the differences yourself as answers have been given in https://stackoverflow.com/questions/46483/htmlentities-vs-htmlspecialchars – Jelmer de Vries May 20 '22 at 13:13
-
@angel.bonev Thanks for your suggestions, but I'm aware of what's these two function does. My concern was if I use this function, would it negatively affect my search function, and if it does, can I solve that. (The user input was for search) – jimmymcheung May 22 '22 at 08:27