stream_filter_register
PHP 5, PHP 7, PHP 8
stream_filter_register - Register a user defined stream filter
Example #1 Filter for capitalizing characters on <span class='function-filename'>foo-bar.txt</span> stream
Result: LINE1
WORD - 2
EASY AS 123
Example #2 Registering a generic filter class to match multiple filter names.
Result: LINE1
WORD - 2
EASY AS 123