OpenCC 的 PHP 扩展 opencc4php

码农软件 · 软件分类 · 常用工具包 · 2019-08-13 20:43:05

软件介绍

opencc4php 是OpenCC的PHP扩展,能很智能的完成简繁体转换。

支持 PHP 版本: 5.3 - 7.1

转换效果:

你干什么不干我事 => 你幹什麼不干我事

地区词汇转换效果:我鼠标哪儿去了 => 我滑鼠哪兒去了

安装

Linux | OS X

你需要先安装1.0.1 版本以上的OpenCC,安装OpenCC:

git clone https://github.com/BYVoid/OpenCC.git --depth 1
cd OpenCC
make
sudo make install

安装opencc4php:

git clone git@github.com:NauxLiu/opencc4php.git --depth 1
cd opencc4php
phpize
./configure
make && sudo make install

如果你的OpenCC安装目录不在/usr或/usr/local,可在./configure时添加--with-opencc=[DIR]指定你的OpenCC目录。

使用方法:

$od = opencc_open("s2twp.json"); //传入配置文件名
$text = opencc_convert("我鼠标哪儿去了。", $od);
echo $text;
opencc_close($od);


本文地址:https://www.codercto.com/soft/d/12303.html

Spring in Action

Spring in Action

Craig Walls / Manning Publications / 2011-6-29 / USD 49.99

Spring in Action, Third Edition has been completely revised to reflect the latest features, tools, practices Spring offers to java developers. It begins by introducing the core concepts of Spring and......一起来看看 《Spring in Action》 这本书的介绍吧!

在线进制转换器
在线进制转换器

各进制数互转换器

随机密码生成器
随机密码生成器

多种字符组合密码

HTML 编码/解码
HTML 编码/解码

HTML 编码/解码