PHP code example of nexuslinkservices / html-tag-purifier

1. Go to this page and download the library: Download nexuslinkservices/html-tag-purifier 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/ */

    

nexuslinkservices / html-tag-purifier example snippets




use HtmlTagPurifier\HtmlTagFilter;

$htmlTagFilter = new HtmlTagFilter();
        
$content = "<p>Thanks for coming.</p><br/><p>I have a special plan for picnic</p>. <b>Super <i>Excited!!</i></b>";
$tags = array("i", "p");

$result = $htmlTagFilter->purify($content, $tags);

Thanks for coming.<br/>I have a special plan for picnic. <b>Super Excited!!</b>