i want to generate json in this format
{
"name": "item1",
"description": "mydescript1"
},
{
"name": "item2",
"description": "mydescript2"
}
i have done this so far
for ($i = 0; $i<sizeof($name_); $i++){
$ToSend_Json["name"] = $name_[$i];
$ToSend_Json["description"] = $description_[$i];
}
echo (json_encode($ToSend_Json));
the output i get for this is the last json which in this case is
{
"name": "item2",
"description": "mydescript2"
}
what will be the correct way to do this