public function doFilter($text, $filters)
    {
        // Define all valid filters with their callback function.
        $callbacks = [
            'bbcode'    => 'bbcode2html',
            'clickable' => 'makeClickable',
            'shortcode' => 'shortCode',
            'markdown'  => 'markdown',
            'nl2br'     => 'nl2br',
            'purify'    => 'purify',
        ];
    
        // Make an array of the comma separated string $filters
        if (is_array($filters)) {
            $filter = $filters;
        } else {
            $filters = strtolower($filters);
            $filter = preg_replace('/\s/', '', explode(',', $filters));
        }
    
        // For each filter, call its function with the $text as parameter.
        foreach ($filter as $key) {
            if (!isset($callbacks[$key])) {
                throw new Exception("The filter '$filters' is not a valid filter string due to '$key'.");
            }
            $text = call_user_func_array([$this, $callbacks[$key]], [$text]);
        }
    
        return $text;
    }
public function doFilter($text, $filters)
    {
        // Define all valid filters with their callback function.
        $callbacks = [
            'bbcode'    => 'bbcode2html',
            'clickable' => 'makeClickable',
            'shortcode' => 'shortCode',
            'markdown'  => 'markdown',
            'nl2br'     => 'nl2br',
            'purify'    => 'purify',
        ];
    
        // Make an array of the comma separated string $filters
        if (is_array($filters)) {
            $filter = $filters;
        } else {
            $filters = strtolower($filters);
            $filter = preg_replace('/\s/', '', explode(',', $filters));
        }
    
        // For each filter, call its function with the $text as parameter.
        foreach ($filter as $key) {
            if (!isset($callbacks[$key])) {
                throw new Exception("The filter '$filters' is not a valid filter string due to '$key'.");
            }
            $text = call_user_func_array([$this, $callbacks[$key]], [$text]);
        }
    
        return $text;
    }
public function doFilter ( $ text , $ filters ) { // Define all valid filters with their callback function. $ callbacks = [ 'bbcode' => 'bbcode2html' , 'clickable' => 'makeClickable' , 'shortcode' => 'shortCode' , 'markdown' => 'markdown' , 'nl2br' => 'nl2br' , 'purify' => 'purify' , ] ; // Make an array of the comma separated string $filters if ( is_array ( $ filters ) ) { $ filter = $ filters ; } else { $ filters = strtolower ( $ filters ) ; $ filter = preg_replace ( '/\s/' , '' , explode ( ',' , $ filters ) ) ; } // For each filter, call its function with the $text as parameter. foreach ( $ filter as $ key ) { if ( ! isset ( $ callbacks [ $ key ] ) ) { throw new Exception ( "The filter '$filters' is not a valid filter string due to '$key'." ) ; } $ text = call_user_func_array ( [ $ this , $ callbacks [ $ key ] ] , [ $ text ] ) ; } return $ text ; }
Call each filter.

@deprecated deprecated since version 1.2 mosbth/textfilter in favour of parse().

@param string       $text    the text to filter.
@param string|array $filters as comma separated list of filter,
or filters sent in as array.

@return string the formatted text.
Call each filter .