PHP code example of acidf0x / php-korean-handler

1. Go to this page and download the library: Download acidf0x/php-korean-handler library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

acidf0x / php-korean-handler example snippets


use AcidF0x\KoreanHandler\Seperator; 

$separator = new Seperator();

$result = $separator->separate("수상하게 돈이 많은");
print_r($result->getSplitList()); // ["ㅅ","ㅜ","ㅅ","ㅏ","ㅇ","ㅎ","ㅏ","ㄱ","ㅔ","ㄷ","ㅗ","ㄴ","ㅇ","ㅣ","ㅁ","ㅏ","ㄶ","ㅇ","ㅡ","ㄴ"]
print_r($result->getChoseongList()); // ["ㅅ", "ㅅ", "ㅎ", "ㄱ", "ㄷ", "ㅇ", "ㅁ", "ㅇ"]
print_r($result->getJungseongList()); // ["ㅜ", "ㅏ", "ㅏ", "ㅔ", "ㅗ", "ㅣ", "ㅏ", "ㅡ"]
print_r($result->getJongseongList()); // ["ㅇ","ㄴ","ㄶ","ㄴ"]

$result = $this->separator->separate("황소");

$result[0]->getChoseong(); // ㅎ
$result[0]->getJungseong(); // ㅘ
$result[0]->getJongseong(); // ㅇ
$result[1]->getChoseong(); // ㅅ
$result[1]->getJungseong(); // ㅗ
$result[1]->getJongseong(); // null

$result[0]->getSplit(); // ["ㅎ", "ㅘ", "ㅇ"]


foreach ($result as $character) {
    $character->getChoseong();
}
bash
 composer