-1

How would I go about converting foreign characters to english characters?

David
  • 208,112
  • 36
  • 198
  • 279
HELP
  • 14,237
  • 22
  • 66
  • 100

3 Answers3

2

Mapping them:

$map = array(
    'รก' => 'a',
    'e' => 'e',
// ...
);

$text = str_replace(array_keys($map), array_values($map), $text);
ssice
  • 3,564
  • 1
  • 26
  • 44
2

PHP has strtr() that can achieve this. Read more here

The first entry under User Contributed Notes has something that should help you

Community
  • 1
  • 1
Chris Ghenea
  • 12,473
  • 1
  • 29
  • 36
0

create an character mapping array with element format: foreign characters => english characters
and replace string with all array element.

erinus
  • 734
  • 4
  • 5