I've been trying to figure out how to get the value of 'text' in this array using PHP and after many attempts, I've not got to the stage of giving up.
Can somebody tell me how to get the translated text in 'text' from this array? It's returned from using the REST API on Microsoft Azure Translator Service and is a JSON object according to documentation, but no matter what I try I can't get any of the text from any part of the array using code. A pointer would be very much appreciated before I lose what hair I have left!
Array
(
[0] => stdClass Object
(
[detectedLanguage] => stdClass Object
(
[language] => en
[score] => 1
)
[translations] => Array
(
[0] => stdClass Object
(
[text] => Entrez votre texte ici
[to] => fr
)
)
)
)