PHP code example of subzeta / glosbe

1. Go to this page and download the library: Download subzeta/glosbe 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/ */

    

subzeta / glosbe example snippets

 
 

use subzeta\Glosbe\Translator;

$response = (new Translator())->translate('music', 'eng', 'spa')->send();
var_dump($response->translations());
var_dump($response->meanings());

 

use subzeta\Glosbe\Translator;

$response = (new Translator())->translate('music', 'eng', 'spa')->includingExamples()->send();
var_dump($response->translations());
var_dump($response->meanings());
var_dump($response->examples());