dejurin/php-google-translate-for-free
最新稳定版本:1.0.0
Composer 安装命令:
composer require dejurin/php-google-translate-for-free
包简介
Library for free use Google Translator. With attempts connecting on failure and array support.
README 文档
README
Packagist: https://packagist.org/packages/dejurin/php-google-translate-for-free
Library for free use Google Translator. With attempts connecting on failure and array support.
Installation
Install this package via Composer.
composer require dejurin/php-google-translate-for-free
Or edit your project's composer.json to require dejurin/php-google-translate-for-free and then run composer update.
"require": { "dejurin/php-google-translate-for-free": "^1.0" }
Usage
require_once ('vendor/autoload.php'); use \Dejurin\GoogleTranslateForFree;
Single
$source = 'en'; $target = 'ro'; $attempts = 5; $text = 'Hello'; $tr = new GoogleTranslateForFree(); $result = $tr->translate($source, $target, $text, $attempts); var_dump($result); /* string(24) "Salut" */
Array
$source = 'en'; $target = 'ro'; $attempts = 5; $arr = ['hello','world']; $tr = new GoogleTranslateForFree(); $result = $tr->translate($source, $target, $arr, $attempts); var_dump($result); /* array(2) { [0]=> string(24) "salut" [1]=> string(6) "lume" } */
License
This source code is distributed under MIT license.
Sponsors
https://currencyrate.today
https://moneyconvert.net/
https://co-w.io/
https://co-in.io/
https://fx-w.io/
统计信息
- 总下载量: 40.57k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 136
- 点击次数: 1
- 依赖项目数: 3
- 推荐数: 0
其他信息
- 授权协议: GPL-3.0
- 更新时间: 2018-03-02