PHP code example of itxq / pinyin
1. Go to this page and download the library: Download itxq/pinyin 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/ */
itxq / pinyin example snippets
// 引入扩展(具体路径请根据你的目录结构自行修改)
use itxq\pinyin\PinYin;
ake()->turn('中文 带空格');
// 仅输出拼音首字母
echo PinYin::make()->turnFirst('中文 带空格');