Get string in dash

@param string $string
@param array $ignoreToReplace
@return mixed
779664
protected function stringWithDash(string $string, array $ignoreToReplace = [])
    {
        return str_replace($this->getToReplace($ignoreToReplace), '-', trim($string, '/'));
    }
997478
private static function strord( $string )
	{ 
		for( $i=0; $i<strlen( $string ); $i++ )
		{ 
			$result[$i] = ord( $string{$i} );
		}
		return $result;
	}
179933
public static function decodeWithChecksum($string, $errmode = self::NORMALIZE_ERRMODE_SILENT)
    {
        $checksum = substr($string, (strlen($string) -1), 1);
        $string = substr($string, 0, strlen($string) - 1);

        $value = static::internalDecode($string, $errmode);
        $checksumValue = static::internalDecode($checksum, self::NORMALIZE_ERRMODE_EXCEPTION, true);

        if ($checksumValue !== ($value % 37)) {
            throw new \RuntimeException("Checksum symbol '$checksum' is not correct value for '$string'");
        }

        return $value;
    }
404384
public function fromRoman($string)
    {
        if (\mb_strlen((string) $string) === 0 || 0 === \preg_match(self::ROMAN_STRING_MATCHER, (string) $string)) {
            throw new \InvalidArgumentException();
        }

        $total = 0;
        $i = \mb_strlen($string);

        while ($i > 0) {
            $digit = $this->map[$string{--$i}];

            if ($i > 0) {
                $previousDigit = $this->map[$string{$i - 1}];

                if ($previousDigit < $digit) {
                    $digit -= $previousDigit;
                    --$i;
                }
            }

            $total += $digit;
        }

        return $total;
    }
468338
public function findCacheByString(string $string, int $siteId = null)
    {

        // Check if already in cache
        if ($this->isCachedByString($string, $siteId)) {
            return $this->cacheByString[$siteId][$string];
        }

        return null;
    }
701737
public static function dashToCamelCase($string)
    {
        $result = '';
        $urlPart = explode('-', $string);
        foreach ($urlPart as $word) {
            $result .= ucfirst(strtolower($word));
        }
        return $result;
    }
1264991
public function copyUntilUnless(string $string, string $unless)
    {
        $lastPos = $this->pos;
        $this->fastForward(1);
        $foundString = $this->copyUntil($string, true, true);

        $position = strcspn($foundString, $unless);
        if ($position == strlen($foundString)) {
            return $string.$foundString;
        }
        // rewind changes and return nothing
        $this->pos = $lastPos;

        return '';
    }
1102472
protected function searchAndReplaceVariables($string)
    {
        return str_replace(
            ['{$major}', '{$minor}', '{$patch}', '{$repository}', '{$build}'],
            [
                $this->getVersion('major'),
                $this->getVersion('minor'),
                $this->getVersion('patch'),
                $this->git->getGitRepository(),
                $this->getBuild(),
            ],
            $string
        );
    }
181633
protected function _pad($text, $ignore = false)
    {
        $blocksize = Horde_Crypt_Blowfish::BLOCKSIZE;
        $padding = $blocksize - (strlen($text) % $blocksize);

        return ($ignore && ($padding == $blocksize))
            ? $text
            : $text . str_repeat(chr($padding), $padding);
    }
541842
private function processStringPlaceholders($string, array $variables)
    {
        foreach ($variables as $key => $value) {
            if (!is_string($value) && !is_numeric($value) && !is_bool($value)) {
                continue;
            }

            $string = str_replace('{'.$key.'}', $value, (string) $string);
        }

        return $string;
    }
1334426
public function evaluateStringOrExpression($string, array &$availableVars)
    {
        $regex = '/^eval: (?P<expr>.+)$/i';
        $success = preg_match($regex, $string, $matches);

        if (!$success) {
            return $string;
        }

        $vars = $availableVars;
        if (array_key_exists(self::CONTEXT_VARS, $availableVars)) {
            $vars = array_merge($availableVars, $availableVars[self::CONTEXT_VARS]);
        }

        return $this->evaluator->evaluateWithVars($matches['expr'], $vars);
    }
1034358
public static function text($string, $breaksEnabled = true)
    {
        $parse = new Parsedown();
        $parse->setBreaksEnabled($breaksEnabled);

        return $parse->text($string);
    }
206154
public static function get( $string, $rule = 'Any-Latin; NFD; [:Nonspacing Mark:] Remove; NFC; [:Punctuation:] Remove; Lower();' ) {
		$trans  = self::createTranslit( $rule );
		$string = preg_replace( '/[-\s]+/', '-', $trans->transliterate( $string ) );
		$out    = trim( $string, '-' );

		return $out;
	}
644404
public function resolveEmbeddedReferences($string)
    {
        $regexp = $this->getEmbeddedRegexp();
        $count = preg_match_all($regexp, $string, $matches);
        // $matches[0][] will have the matched full string eg.: [reference:example_reference]
        if ($count) {
            foreach ($matches[0] as $referenceIdentifier) {
                $reference = $this->getReferenceValue(substr($referenceIdentifier, 1, -1));
                if (!is_array($reference)) {
                    $string = str_replace($referenceIdentifier, $reference, $string);
                }
            }
        }

        return $string;
    }
494017
public function get_value($string)
    {
        // now just drop the msb and reorder it + parse it in own string
        $valuestring = '';
        $string_length = strlen($string);

        $i = 1;

        while ($string_length > $i)
        {
            // unset msb string and reorder it
            $valuestring = substr($string, $i, 7) . $valuestring;
            $i += 8;
        }

        // now interprete it
        return bindec($valuestring);
    }
429329
public function getToReplace(array $ignoreSymbols): array
    {
        if( empty($ignoreSymbols) )
            return $this->toReplace;

        return array_diff($this->toReplace, $ignoreSymbols);
    }
1113629
public function dt( $domain, $string )
	{
		$key = $this->_prefix . $domain . '|' . $this->getLocale() . '|' . $string;

		// regular cache
		$success = false;
		$value = apc_fetch( $key, $success );

		if( $success === true ) {
			return $value;
		}

		// not cached
		$value = parent::dt( $domain, $string );

		apc_store( $key, $value );

		return $value;
	}