Skip to content

Latest commit

 

History

History
17 lines (15 loc) · 637 Bytes

README.md

File metadata and controls

17 lines (15 loc) · 637 Bytes

PHP Google Translate (Free)

A simple PHP library to translate texts using Google Translate for free. There is also a paid version of Google Translate (requires an API key).

Install

composer require nggit/php-gtranslate-free:dev-master

Usage

require __DIR__ . '/vendor/autoload.php';
use Nggit\Google\Translate;

$translate = new Translate(array('lang' => array('de' => 'en'))); // translate from german to english
$translate->setText('Der schnelle Braune Fuchs springt über den faulen Hund');

echo $translate->process()->getResults();

Enjoy!