PHP Package: symfony/html-sanitizer

A PHP library providing SEO-optimized HTML sanitization for secure content filtering in web applications.

Current Version: 7.3.0
Last Updated: 2025-05-29
PHP Requirement: >=8.2
Dependencies:
symfony/css-selector
symfony/dom-crawler
symfony/polyfill-php80
⚠️ To ensure full functionality, the above dependencies might be required.

Package Description

Symfony's HTML Sanitizer library offers advanced capabilities for cleansing and securing HTML content to ensure compliance with SEO standards. With a focus on performance and reliability, this library empowers developers to filter user-generated content effectively. It supports a wide range of HTML tags, attributes, and styles, making it a versatile solution for sanitizing web content.

📦 Show all available classes🔗 View on GitHub

Download Latest Version: 7.3.0

Download Download v7.3.0

Previous Versions

Code Integration Example

Make sure to include the correct namespace and class paths for proper usage.

<?php
// Example from PHPlibraries.com
require_once 'libs/symfony/html-sanitizer/7.3.0/loader.php';
require_once 'libs/symfony/css-selector/7.3.0/loader.php';
require_once 'libs/symfony/dom-crawler/7.3.0/loader.php';
require_once 'libs/symfony/polyfill-php80/1.32.0/loader.php';

use Symfony\Component\HtmlSanitizer\HtmlSanitizer;
use Symfony\Component\HtmlSanitizer\Extension\HtmlSanitizerExtension;
use Symfony\Component\CssSelector\CssSelectorConverter;

$obj = new HtmlSanitizer();
echo '✅ Test OK: ' . get_class($obj);
?>

We aim to make using PHP packages easier without Composer. If something doesn't work, let us know — we'll fix it promptly.

Community Discussion

Ask questions, share tips, or report issues below.