I am trying to use the google translation API as shown on this page...
https://developers.google.com/translate/v2/using_rest
When I replace my API key, it works correctly and display the translated text as shown below.
GET https://www.googleapis.com/language/translate/v2?key=INSERT-YOUR-KEY&target=de&q=Hello%20world
{
"data": {
"translations": [
{
"translatedText": "Hallo Welt",
"detectedSourceLanguage": "en"
}
]
}
}
I will like to return only the text i.e. "Hallo Welt" using PHP.
I used json_decode function, but it returns everything.