How to improve the maintainability of PHP code by using named callback functions?
A named callback function refers to referring to a defined function in the code as a callback, rather than defining an anonymous function directly in the code. Compared with anonymous functions, named callback functions are better readability, reusability, and are more convenient when debugging and maintenance are required.
preg_replace_callback_array