preg_replace_callback_array

Supported Versions: PHP 7, PHP 8
Perform a regular expression search and replace using callbacks
<?php preg_replace_callback_array(    array $pattern,    string|array $subject,    int $limit = -1,    int &$count = null,    int $flags = 0): string|array|null