PHP Classes

File: README.md

Recommend this page to a friend!
  Classes of Peter Kahl   Chinese Master   README.md   Download  
File: README.md
Role: Documentation
Content type: text/markdown
Description: Documentation
Class: Chinese Master
Detect and convert text in Chinese
Author: By
Last change: Removed static
Date: 4 years ago
Size: 1,112 bytes
 

Contents

Class file image Download

Chinese Master

Downloads Download per Month License

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('???'); # ???