Search
 
SCRIPT & CODE EXAMPLE
 

PHP

google translate 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));
?>
Comment

google api for language translation in php

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

PREVIOUS NEXT
Code Example
::  
::  
Php ::  
:: random number laravel faker 
Php ::  
Php ::  
::  
:: max. post size 
::  
Php ::  
::  
Php :: convert xml file to array php 
:: php foreach count rows 
Php :: php remove last 3 letters from string 
Php ::  
Php ::  
::  
:: https redirect in htacess for php laravel 
:: laravel model limit 
::  
:: php microtime to seconds 
::  
Php :: 15000 tl to usd 
::  
:: laravel set config value dynamically 
Php :: print array items in php 
::  
::  
Php ::  
::  
ADD CONTENT
Topic
Content
Source link
Name
5+2 =