src/Transliterator.php
public static function transliterate( $string, $flag = self::DIACRITICS ) {

		if ( $flag === ( $flag | self::NONE ) ) {
			return $string;
		}

		if ( !isset( self::$transliterationMap[$flag] ) ) {
			$transliterationMap = array();

			if ( $flag === ( $flag | self::GREEK ) ) {
				$transliterationMap += self::$greekMap;
			}

			if ( $flag === ( $flag | self::DIACRITICS ) ) {
				$transliterationMap += self::$diacriticsMap;
			}

			// Keep it static for the duration of a request to avoid negative
			// performance impact
			self::$transliterationMap[$flag]['k'] = array_keys( $transliterationMap );
			self::$transliterationMap[$flag]['v'] = array_values( $transliterationMap );

			unset( $transliterationMap );
		}

		return str_replace(
			self::$transliterationMap[$flag]['k'],
			self::$transliterationMap[$flag]['v'],
			$string
		);
	}
public static function transliterate( $string, $flag = self::DIACRITICS ) {

		if ( $flag === ( $flag | self::NONE ) ) {
			return $string;
		}

		if ( !isset( self::$transliterationMap[$flag] ) ) {
			$transliterationMap = array();

			if ( $flag === ( $flag | self::GREEK ) ) {
				$transliterationMap += self::$greekMap;
			}

			if ( $flag === ( $flag | self::DIACRITICS ) ) {
				$transliterationMap += self::$diacriticsMap;
			}

			// Keep it static for the duration of a request to avoid negative
			// performance impact
			self::$transliterationMap[$flag]['k'] = array_keys( $transliterationMap );
			self::$transliterationMap[$flag]['v'] = array_values( $transliterationMap );

			unset( $transliterationMap );
		}

		return str_replace(
			self::$transliterationMap[$flag]['k'],
			self::$transliterationMap[$flag]['v'],
			$string
		);
	}
@since 0.1

@param string $string
@param integer $flag

@return string