dlueth
6/27/2013 - 9:29 PM

PHP modifier to transliterate a given string (requires iconv, mb_string)

PHP modifier to transliterate a given string (requires iconv, mb_string)

function transliterate($value, $characterset) {
  return iconv(mb_detect_encoding($value, NULL, true), $characterset . '//IGNORE//TRANSLIT', trim($value));
}