PKPString::regexp_replace_callback PHP Method

regexp_replace_callback() static public method

See also: http://ca.php.net/manual/en/function.regexp_replace_callback.php
static public regexp_replace_callback ( $pattern, $callback, $subject, $limit ) : mixed
$pattern string Regular expression
$callback callback PHP callback to generate content to replace matches with
$subject string String to apply regular expression to
$limit int Number of replacements to perform, maximum, or -1 for no limit.
return mixed
    static function regexp_replace_callback($pattern, $callback, $subject, $limit = -1)
    {
        if (PCRE_UTF8 && !self::utf8_compliant($subject)) {
            $subject = self::utf8_bad_strip($subject);
        }
        return preg_replace_callback($pattern . PCRE_UTF8, $callback, $subject, $limit);
    }