peterkahl / chinese-master
Chinese traditional/simplified conversion; traditional/simplified detection.
Installs: 5 294
Dependents: 1
Suggesters: 0
Security: 0
Stars: 5
Watchers: 1
Forks: 0
Open Issues: 0
Requires
- php: >=5.3.0
README
Chinese traditional/simplified conversion; traditional/simplified detection.
Usage
use peterkahl\ChineseMaster\ChineseMaster; $chm=new ChineseMaster; /** * Does string include (1 or more) characters of traditional Chinese script? * */ $isTraditional=$chm->isTraditional('龙'); # false $isTraditional=$chm->isTraditional('龍'); # true $isTraditional=$chm->isTraditional('龙龍'); # true /** * Convert text in traditional script to simplified. * */ echo $chm->trad2simp('灣龍爾'); # 湾龙尔 /** * Convert text in simplified script to traditional. * CAUTION: You will encouter errors as the size of the simplified * array is maller that that of the traditional. */ echo $chm->simp2trad('湾龙尔'); # 灣龍爾