0xV3NOMx
Linux ip-172-26-7-228 5.4.0-1103-aws #111~18.04.1-Ubuntu SMP Tue May 23 20:04:10 UTC 2023 x86_64



Your IP : 3.138.137.175


Current Path : /var/www/website/nublr/Regulations/simplehtmldom/manual/docs/manual/
Upload File :
Current File : /var/www/website/nublr/Regulations/simplehtmldom/manual/docs/manual/customizing-parsing-behavior.md

---
title: Customizing Parsing behavior
---

```php
// Write a function with parameter "$element"
function my_callback($element) {
        // Hide all <b> tags
        if ($element->tag === 'b')
                $element->outertext = '';
}

// Register the callback function with it's function name
$html->set_callback('my_callback');

// Callback function will be invoked while dumping
echo $html;
```