“Google API dla tłumaczenia języka w PHP” Kod odpowiedzi

Tłumacz Google API PHP

<?php
    $apiKey = '<paste your API key here>';
    $url = 'https://www.googleapis.com/language/translate/v2/languages?key=' . $apiKey;

    $handle = curl_init($url);
    curl_setopt($handle, CURLOPT_RETURNTRANSFER, true);     //We want the result to be saved into variable, not printed out
    $response = curl_exec($handle);                         
    curl_close($handle);

    print_r(json_decode($response, true));
?>
Alive Ant

Google API dla tłumaczenia języka w PHP

1
2
$result = $translate->detectLanguage('Bonjour le monde!');
echo $result['languageCode']; // output is 'fr'
Perfect Pigeon

Odpowiedzi podobne do “Google API dla tłumaczenia języka w PHP”

Pytania podobne do “Google API dla tłumaczenia języka w PHP”

Więcej pokrewnych odpowiedzi na “Google API dla tłumaczenia języka w PHP” w PHP

Przeglądaj popularne odpowiedzi na kod według języka

Przeglądaj inne języki kodu