Example #1
0
    {
        $pattern = '`~!@#$%^&*()-_=+{}[]\\\\|;:\'",.<>/?+';
        if (!empty($input_except)) {
            $pattern = preg_replace('#[' . preg_quote($input_except, '#') . ']+#is', '', $pattern);
        }
        return preg_replace('#[' . preg_quote($pattern, '#') . ']+#is', $input_replace_char, $input_text);
    }
    public static function removeShortcode($string, $replace = '')
    {
        $string = preg_replace('#\\[([a-z0-9\\_]+)[^\\]]*\\](\\[/\\1\\])?#is', $replace, $string);
        $string = trim($string);
        return $string;
    }
    public static function removeVietnameseMark($text)
    {
        foreach (self::$defaultParams['vietnamese_chars'] as $key1 => $value1) {
            $text = str_replace($value1['mark'], $value1['unmark'], $text);
            unset($key1, $value1);
        }
        reset(self::$defaultParams['vietnamese_chars']);
        return $text;
    }
    public static function decodeText($input_text)
    {
        $input_text = rawurldecode($input_text);
        $input_text = html_entity_decode($input_text, ENT_QUOTES, 'UTF-8');
        return $input_text;
    }
}
Text::setDefaultParams();