By encode, do you mean: Convert all applicable characters to HTML entities?
htmlspecialchars
or
htmlentities
You can also use strip_tags if you want to remove all HTML tags :
Note: this will NOT stop all XSS attacks
More Related Contents:
- How to remove html special chars? [duplicate]
- How to reverse htmlentities()?
- Needle in a Haystack for Php [closed]
- Multiple inputs with same name through POST in php
- Lost connection to MySQL server at ‘reading initial communication packet’, system error: 0
- Is there a PDF parser for PHP? [closed]
- How to set proper codeigniter base url?
- String with array structure to Array [duplicate]
- Use php to set cron jobs in Windows
- How to run php files on my computer
- Get image color
- Select entries between dates in doctrine 2
- Parsing CSS by regex
- PHP string interpolation syntax
- Merge XML files in PHP
- Mysqli fetch_assoc vs fetch_array
- Push elements from one array into rows of another array (one element per row)
- Create a comma-separated string from a single column of an array of objects
- Grouping arrays in PHP
- PHP check value against multiple values with OR-operator
- LIKE query using multiple keywords from search field using PDO prepared statement
- Object of class stdClass could not be converted to string
- Why do I get “Resource id #4” when I apply print_r() to an array in PHP? [duplicate]
- PHP script to execute at certain times
- Is header(‘Content-Type:text/plain’); necessary at all?
- How do I check in PHP that I’m in a static context (or not)?
- Why does (0 == ‘Hello’) return true in PHP?
- Set character set using MySQLi
- how to execute mysql command DELIMITER
- php in background exec() function