直接放在ThinkPHP\Extend\Library\ORG\Util里就可以了
然后引入
import("ORG.Util.Pinyin");
$py = new PinYin();
echo $py->getAllPY("输出汉字所有拼音"); //shuchuhanzisuoyoupinyin
echo $py->getFirstPY("输出汉字首拼音"); //schzspy
还有一个API,不过怕某天不能用了,,大家可以去研究下
http://huoqu.sinaapp.com/pinyin/utf8.html