PHP - htmlentities Function

Again I want to say sorry to all of you that I was not posting in last few days just drafting all the time. But now I’m publishing all the stuff which I draft in last few days.

Whenever you allow your users to submit text to your website, you need to be careful that you don’t leave any security holes open for malicious users to exploit. If you are ever going to allow user submitted text to be visible by the public you should consider using the htmlentities function to prevent them from running html code and scripts that may be harmful to your visitors.

PHP - Converting HTML into Entities

The htmlentities function takes a string and returns the same string with HTML converted into HTML entities. For example, the string “