ChineseCharacter.Class.php 451 B

12345678910111213141516171819202122232425262728
  1. <?php
  2. /**
  3. * 汉字处理
  4. * Created by PhpStorm.
  5. * User: 小威
  6. * Date: 2020/04/23
  7. * Time: 15::04
  8. */
  9. namespace Util\Common;
  10. use Mall\Framework\Core\ErrorCode;
  11. Use Mall\Framework\Core\ResultWrapper;
  12. use Util\PinYin\PinYin;
  13. class ChineseCharacter
  14. {
  15. /**
  16. * 获取汉字拼音首字母
  17. * @param $zhString
  18. * @return string
  19. */
  20. function getInitials($zhString)
  21. {
  22. return PinYin::convertInitalPinyin($zhString);
  23. }
  24. }