PHP code example of tf-pro / chinese
1. Go to this page and download the library: Download tf-pro/chinese 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/ */
tf-pro / chinese example snippets
`
use TFPro\Chinese\Chinese;
$chs = '中国人';
$cht = '中國人';
// 简繁体获取拼音
var_dump(Chinese::pinyin($chs));
var_dump(Chinese::pinyin($cht));
// 简繁体转换
var_dump(Chinese::turn($chs));
var_dump(Chinese::turn($cht, true));