-
-
Notifications
You must be signed in to change notification settings - Fork 764
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
建议新增获取拼音首字母功能 #1
Comments
OK,没问题,请稍等几日,最近忙于公司项目
|
@LiXunGuan 已经添加获取首字母方法: include __DIR__ . '/src/Overtrue/Pinyin.php';
$str = "带着希望去旅行,比到达终点更美好";
$pingyin = new Overtrue\Pinyin;
echo $pingyin->firstLetter($str), "\n";
// D Z X W Q L X B D D Z D G M H
echo $pingyin->firstLetter($str, ''), "\n";
//DZXWQLXBDDZDGMH
echo $pingyin->firstLetter($str, '-'), "\n";
//D-Z-X-W-Q-L-X-B-D-D-Z-D-G-M-H 另外修改了一下调用方法, 请查看项目README。 |
3Q,国庆期间还在coding |
哈哈
|
如果能搞成静态方法就更好了(PS laravel4用习惯了...强迫症) |
@ok。稍等 |
Pinyin::trans('我们', array('delimiter' => '', 'first' => true));
输出 // wm
The text was updated successfully, but these errors were encountered: