DownloadChinese Master
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('?')) ? true : false; # false
$isTraditional = ($chm->isTraditional('?')) ? true : false; # true
$isTraditional = ($chm->isTraditional('??')) ? true : false; # true
/
* Convert text in traditional script to simplified.
*
*/
echo $chm->trad2simp('???'); # ???
/
* Convert text in simplified script to traditional.
*
*/
echo $chm->simp2trad('???'); # ???
|