PHP code example of zmog / php-lingea-ltbe

1. Go to this page and download the library: Download zmog/php-lingea-ltbe 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-ltbe example snippets




key = 'you_api_key';

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

$ResponseTranslateSync = $TranslationApi->translateSync($text,\Zmog\Libs\Lingea\LTBE\TranslationLanguage\ISO_639_2b::fromCode('eng'),\Zmog\Libs\Lingea\LTBE\TranslationLanguage\ISO_639_1::fromCode('cs'));
echo "Translation of : $text is : ".PHP_EOL;
echo $ResponseTranslateSync->getResult();
bash
composer