pinyin-php is a php extension which could translate Chinese character into Chinese PinYin.
linux
build the extension
phpize
configure
make
make test
add following into php.ini
pinyin.chars=/path/to/chars.csv
pinyin.words=/path/to/words.csv
pinyin.locale="en_GB.UTF-8" [optional]
<?php
echo pinyin("汉"),"\n";
echo pinyin("わたしわ阿飞, and my English name is Rex Lee. 网名是独孤影! ^_^。下面是一段多音分词歧义测试,这个人无伤无臭味。"),"\n";
?>
MIT License