PHP code example of eyupcanakman / htmlawed

1. Go to this page and download the library: Download eyupcanakman/htmlawed library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

eyupcanakman / htmlawed example snippets


echo Htmlawed::filter('<h1>Hello world!');
// Outputs: '<h1>Hello world!</h1>'

echo Htmlawed::filter('<i>nothing to see</i><script>alert("xss")</script>');
// Outputs: '<i>nothing to see</i>alert("xss")'

// RSS filtering
echo Htmlawed::filterRSS('<html><body><h1>Hello world!</h1></body></html>');
// Outputs: '<h1>Hello world!</h1>'