convert

@param string $text
@return string
978586
public static function convert($text)
    {
        static $parser;

        if (empty($parser)) {
            $parser = new MarkdownExtraExtended();
        }

        return $parser->transform($text);
    }
770588
public static function strtotitle($text) {
        if (empty($text)) {
            return $text;
        }

        if (function_exists('mb_convert_case')) {
            return mb_convert_case($text, MB_CASE_TITLE, 'UTF-8');
        }

        $text = self::strtolower($text);
        $words = explode(' ', $text);
        foreach ($words as $i=>$word) {
            $length = self::strlen($word);
            if (!$length) {
                continue;

            } else if ($length == 1) {
                $words[$i] = self::strtoupper($word);

            } else {
                $letter = self::substr($word, 0, 1);
                $letter = self::strtoupper($letter);
                $rest   = self::substr($word, 1);
                $words[$i] = $letter.$rest;
            }
        }
        return implode(' ', $words);
    }
996319
protected function _encode($text)
    {
        $restore = mb_internal_encoding();
        mb_internal_encoding($this->_appCharset);
        if (empty($this->headerCharset)) {
            $this->headerCharset = $this->charset;
        }
        $return = mb_encode_mimeheader($text, $this->headerCharset, 'B');
        mb_internal_encoding($restore);

        return $return;
    }
923609
public function parse($text)
    {
        if (empty($text)) {
            return '';
        }

        return $this->driver->text(
            static::removeLeadingWhitespace($this->escape($text))
        );
    }
723485
public static function humanize(string $text): string
    {
        $text = \str_replace(['-', '_'], ' ', $text);

        return Stringy::create($text)->humanize()->titleize();
    }
536167
public function clean($text)
    {
        if (!$this->type) {
            return $text;
        }

        return static::$filter->clean($text, $this->type);
    }
250486
public static function slugify(string $text) : string 
    {
        $lowerText = strtolower($text);
        $arrTransform = [
            "ä" => "ae",
            "à" => "a",
            "á" => "a",
            "ą" => "a",
            "â" => "a",
            "å" => "a",
            "Æ" => "ae",
            "æ" => "ae",
            "ç" => "c",
            "é" => "e",
            "è" => "e",
            "ê" => "e",
            "ē" => "e",
            "ë" => "e",
            "í" => "i",
            "ì" => "i",
            "î" => "i",
            "ī" => "i",
            "ï" => "i",
            "ñ" => "n",
            "ö" => "oe",
            "ô" => "o",
            "ô" => "o",
            "ǫ" => "o",
            "ò" => "o",
            "õ" => "o",
            "ø" => "o",
            "ẞ" => "ss",
            "ß" => "ss",
            "ü" => "ue",
            "û" => "ue",
            "ù" => "ue",
            "ú" => "ue",
            "ȳ" => "y",
            "ŷ" => "y",
            "ŷ" => "y",
        ];
        
        foreach ($arrTransform as $key => $val) {
            $lowerText = str_replace($key, $val, $lowerText);
        }
        
        //Final check, just make sure no special chars and replace all other chars with minus
        $slug = (string) preg_replace('/[^a-z0-9-]+/', '-', $lowerText);
        return $slug;
    }
154169
public static function normalizeText($text)
    {
        $text = strtolower($text);
        $text = preg_replace('/[^a-z0-9 -]/im', ' ', $text);
        $text = preg_replace('/( +)/im', ' ', $text);

        return trim($text);
    }
112367
public static function ampReplace($text)
    {
        $text = str_replace('&&', '*--*', $text);
        $text = str_replace('&#', '*-*', $text);
        $text = str_replace('&amp;', '&', $text);
        $text = preg_replace('|&(?![\w]+;)|', '&amp;', $text);
        $text = str_replace('*-*', '&#', $text);
        $text = str_replace('*--*', '&&', $text);

        return $text;
    }
960710
protected function prepare($text)
    {
        if ($this->getConfig('asciiConversion', true)) {
            setlocale(LC_ALL, 'en_us.UTF8');

            $text = iconv('UTF-8', 'ASCII//TRANSLIT', $text);
        }

        $text = trim(strtolower($text));
        $text = str_replace(["\t", "\r\n", "\r", "\n"], "", $text);

        // Convert some characters that 'MAY' be used as alias
        $text = str_replace(["@", "$", "[dot]", "(dot)"], ["at", "s", ".", "."], $text);

        // Strip multiple dots (.) to one. eg site......com to site.com
        $text = preg_replace("/\.{2,}/", ".", $text);

        // Remove special characters
        return preg_replace("/[^a-zA-Z0-9-\.\s]/", "", $text);
    }
781656
protected function trans($text)
    {
        if (isset($this->translator)) {
            return $this->translator->trans('dataTable.'.$text);
        }

        return $text;
    }
313432
public static function strip(string $text): string
    {
        if (false === \strpos($text, '</')) {
            return $text;
        }

        // $text = \strip_tags($text);
        return \preg_replace(self::STRIP_TAG, '', $text);
    }
1241713
private static function toCamelCase(string $text): string
    {
        if (strpos($text, '_') !== false) {
            $text = str_replace(' ', '', ucwords(str_replace('_', ' ', $text)));
        }
        $text[0] = strtolower($text[0]);

        return $text;
    }
162906
public static function nl2paragraph($text)
    {
        $paragraphs = explode("\n", $text);

        foreach ($paragraphs as &$paragraph) {
            $paragraph = "<p>$paragraph</p>";
        }

        return implode('', $paragraphs);
    }
519294
public static function ampReplace($text)
    {
        $text = str_replace([
            '&&',
            '&#',
            '&#',
            '&amp;',
            '*-*',
            '*--*',
        ], [
            '*--*',
            '*-*',
            '*-*',
            '&',
            '&#',
            '&&',
        ], $text);

        $text = (string)preg_replace('/|&(?![\w]+;)|/', '&amp;', $text);

        return $text;
    }
449875
public function parse(string $text) : string
    {
        $tokens = $this->tokenizer->tokenize($text);
        $segments = $this->createSegments($tokens);
        $nodes = $this->createTree($segments);
        return $this->generator->generateMarkup($nodes);
    }
105078
public function normalizeText( $text )
    {
        if ( $this->searchHandler instanceof LegacyHandler )
        {
            $searchEngine = new eZSearchEngine();
            return $searchEngine->normalizeText( $text );
        }

        return $text;
    }