Stringy\Stringy::eregReplace PHP Méthode

eregReplace() private méthode

Alias for mb_ereg_replace with a fallback to preg_replace if the mbstring module is not installed.
private eregReplace ( $pattern, $replacement, $string, $option = 'msr' )
    private function eregReplace($pattern, $replacement, $string, $option = 'msr')
    {
        static $functionExists;
        if ($functionExists === null) {
            $functionExists = function_exists('\\mb_split');
        }
        if ($functionExists) {
            return \mb_ereg_replace($pattern, $replacement, $string, $option);
        } else {
            if ($this->supportsEncoding()) {
                $option = str_replace('r', '', $option);
                return \preg_replace("/{$pattern}/u{$option}", $replacement, $string);
            }
        }
    }