src/GoogleTranslate.php
protected static function getSentencesFromJSON($json)
    {
        $sentencesArray = json_decode($json, true);
        $sentences = "";

        foreach ($sentencesArray["sentences"] as $s) {
            $sentences .= isset($s["trans"]) ? $s["trans"] : '';
        }

        return $sentences;
    }
protected static function getSentencesFromJSON($json)
    {
        $sentencesArray = json_decode($json, true);
        $sentences = "";

        foreach ($sentencesArray["sentences"] as $s) {
            $sentences .= isset($s["trans"]) ? $s["trans"] : '';
        }

        return $sentences;
    }
protected static function getSentencesFromJSON ( $ json ) { $ sentencesArray = json_decode ( $ json , true ) ; $ sentences = "" ; foreach ( $ sentencesArray [ "sentences" ] as $ s ) { $ sentences .= isset ( $ s [ "trans" ] ) ? $ s [ "trans" ] : '' ; } return $ sentences ; }
Dump of the JSON's response in an array

@param string $json
The JSON object returned by the request function

@return string A single string with the translation
Dump of the JSON s response in an array