I have the json data like this
{
"Sentence": {
"Subject": {
"Name": "Tom"
},
"Verb": {
"verb1": "is",
"verb2": "eating"
},
"Object": {
"Fruit": "Banana"
}
},
"Sentence2": {
"Subject": {
"Name": "Mary"
},
"Verb": {
"verb1": "eats",
},
"Object": {
"Fruit": "Apple"
}
}
}
Then , I convert it to array by
$array = json_decode($json,true);
And I got the array ,
array(2) {
["Sentence"]=>
array(3) {
["Subject"]=>
array(1) {
["Name"]=>
string(3) "Tom"
}
["Verb"]=>
array(2) {
["verb1"]=>
string(2) "is"
["verb2"]=>
string(6) "eating"
}
....
Now , I want get the result only , like
"Tom is eating banana"
"Mary eats Apple".
The structure of the two sentence are not same, how can i do ?