PHP code example of maciejkrol / wikidiki

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

    

maciejkrol / wikidiki example snippets


//instantiate
$wikidiki = new \maciejkrol\wikidiki\wikidiki ();

$word       =   'Tea';
$language   =   'en';

$translated = $wikidiki->translate($word, $language);   //array

$word       =   'Tea';
$language   =   'en';
$to         =   'pl';

$translated = $wikidiki->translate($word, $language, $to);   //string

$word       =   'Tea';
$language   =   'en';
$to         =   ['pl', 'it'];

$translated = $wikidiki->translate($word, $language, $to);   //array

$word       =   'Tea';
$language   =   'en';

$translated = $wikidiki->suggest($word, $language, $to);   //array