0

I am making a transliteration function in php. I need to loop through all the characters in the text, check the unicode value, and assign the equivalent Latin letter. I managed to do this in Javascript using charCodeAt, but I have been struggling to find a php equivalent that works.

This is part of the code I created in Javascript.

var latin = '';
for(i=0; i<w.length; i++){
  var unic = w.charCodeAt(i);
  var letter = '';
  if(unic == 1488){letter = "'";}
  if(unic == 1489){letter = 'v';}

  latin += letter;
}
jcvamp
  • 25
  • 8

0 Answers0