src/Support/Str.php
/**
	 * Transliterate a UTF-8 value to ASCII.
	 *
	 * @param string $value
	 * @param string $language
	 * @return string
	 */
Transliterate a UTF-8 value to ASCII.
Transliterate a UTF - 8 value to ASCII .
public static function ascii($value, $language = 'en') {
		$languageSpecific = static::languageSpecificCharsArray($language);
		if (!is_null($languageSpecific)) {
			$value = str_replace($languageSpecific[0], $languageSpecific[1], $value);
		}
		foreach (static::charsArray() as $key => $val) {
			$value = str_replace($val, $key, $value);
		}
		return preg_replace('/[^\x20-\x7E]/u', '', $value);
	}
public static function ascii ( $ value , $ language = 'en' ) { $ languageSpecific = static :: languageSpecificCharsArray ( $ language ) ; if ( ! is_null ( $ languageSpecific ) ) { $ value = str_replace ( $ languageSpecific [ 0 ] , $ languageSpecific [ 1 ] , $ value ) ; } foreach ( static :: charsArray ( ) as $ key => $ val ) { $ value = str_replace ( $ val , $ key , $ value ) ; } return preg_replace ( '/[^\x20-\x7E]/u' , '' , $ value ) ; }
Transliterate a UTF-8 value to ASCII.
Transliterate a UTF - 8 value to ASCII .