PHP code example of zmog / php-lingea

1. Go to this page and download the library: Download zmog/php-lingea library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

zmog / php-lingea example snippets




key = 'you_api_key';

$TranslationApi = new \Zmog\Libs\Lingea\TranslationApi($api_key);
$text = 'Hello, my name is Mathieu.';

$translated_text = $TranslationApi->translate($text,\Zmog\Libs\Lingea\TranslationLanguage\ISO_639_2b::fromCode('eng'),\Zmog\Libs\Lingea\TranslationLanguage\ISO_639_1::fromCode('cs'),\Zmog\Libs\Lingea\TranslationFormat\Plain::instance());
bash
composer 

php test/language.php "my_api_key"
php test/translate.php "my_api_key"