peterkahl/chinese-master

Chinese traditional/simplified conversion; traditional/simplified detection.

v0.6.1 2018-03-22 14:54 UTC

README

Downloads Download per Month License If this project has business value for you then don't hesitate to support me with a small donation.

Chinese traditional/simplified conversion; traditional/simplified detection.

Usage

Is a string using traditional Chinese script?

use peterkahl\ChineseMaster\ChineseMaster;

if (ChineseMaster::isTraditional('繁體字')) {
  echo 'traditional';
}
else {
  echo 'simplified';
}

# traditional

Convert text in traditional script to simplified.

use peterkahl\ChineseMaster\ChineseMaster;

echo ChineseMaster::trad2simp('灣龍爾'); # 湾龙尔

Convert text in simplified script to traditional.

use peterkahl\ChineseMaster\ChineseMaster;

echo ChineseMaster::simp2trad('湾龙尔'); # 灣龍爾