preg_filter

Supported Versions: PHP 5 >= 5.3.0, PHP 7, PHP 8
Perform a regular expression search and replace
<?php preg_filter(    string|array $pattern,    string|array $replacement,    string|array $subject,    int $limit = -1,    int &$count = null): string|array|null
<?php     {

        return array_merge(

            ['All providers and tags'],

            preg_filter('/^/', '<fg=gray>Provider:</> ', Arr::sort(ServiceProvider::publishableProviders())),

            preg_filter('/^/', '<fg=gray>Tag:</> ', Arr::sort(ServiceProvider::publishableGroups()))

        );

    }
<?php         return array_merge(

            ['All providers and tags'],

            preg_filter('/^/', '<fg=gray>Provider:</> ', Arr::sort(ServiceProvider::publishableProviders())),

            preg_filter('/^/', '<fg=gray>Tag:</> ', Arr::sort(ServiceProvider::publishableGroups()))

        );

    }