Possible Duplicate:
How to parse a JSON string using PHP
this is my data object
{
"data": {
"translations": [
{
"translatedText": "Hallo Welt"
},
{
"translatedText": "Hallo Berlin"
}
]
}
}
how do I parse this using PHP?
this is a jsonObject that contains jsonObject("data") that contains jsonArray that contains jsonObjects at each index that contains key/value "translatedText"
this is what I have and my assumption
$jsonResult = json_decode($data);
$translated_text = $jsonResult->data->translations[0]->translatedText;`
json_decode()
? – PeeHaa yesterdayvar_dump($jsonResult);
? – PeeHaa yesterday