I am trying to use google trnslation apis to translate some texts from English to Dutch. I have the following code:-
$text = urlencode($text);
$from_lan = 'en';
$to_lan = 'nl';
$url = "https://translate.googleapis.com/translate_a/single?client=p&sl=".$from_lan."&tl=".$to_lan."&dt=t&q=".$text;
$ch = curl_init();
curl_setopt( $ch, CURLOPT_URL, $url);
curl_setopt( $ch, CURLOPT_RETURNTRANSFER, true);
$content = curl_exec($ch);
print_r($content);
The data which I am getting is:-
[[["uitzicht","view",,,2]],,"en"]
It is not array or json data. It is string. How can I get data in json format