, (*1)
korean-romanizer
PHP 5.4+ library to romanize Korean in UTF-8 format., (*2)
Description
Uses the "Revised Romanization of Korean (๊ตญ์ด์ ๋ก๋ง์ ํ๊ธฐ๋ฒ)" which is the official Korean language romanization system in South Korea proclaimed by Ministry of Culture, Sports and Tourism. Wikipedia page., (*3)
Notice that this is different from transliteration, which comes implemented in PHP's intl extension (Transliterator class).
For example, "์์ญ๋ฆฌ" subway stop is transliterated as "wangsibli" but romanized as "wangsimni" (which is closer to the Korean pronuntiation)., (*4)
Usage
First add this library as requirement in your composer.json file. If you are not familiar with Composer, please read its documentation first., (*5)
{
"require": {
"liopic/korean-romanizer": "~1.0"
}
}
Then create a new KoreanRomanizer\Romanizer() instance with the Korean text in UTF-8 you want to romanize.
For example:, (*6)
require "vendor/autoload.php";
$example = new KoreanRomanizer\Romanizer("์๋
ํ์ธ์");
echo $example->romanize(); //Displays "annyeong haseyo"