SyntaxFix
Write A Post
Hire A Developer
Questions
By encode, do you mean: Convert all applicable characters to HTML entities?
htmlspecialchars or htmlentities
htmlspecialchars
htmlentities
You can also use strip_tags if you want to remove all HTML tags :
strip_tags
Note: this will NOT stop all XSS attacks