{
"Students": {
"Name": "John",
"Id": "123"
},
{
"Name": "Mickel",
"Id": "4331"
},
"Status": "Success"
}
And I Want To Make Like This In PHP How I Can Make It
{
"Students": {
"Name": "John",
"Id": "123"
},
{
"Name": "Mickel",
"Id": "4331"
},
"Status": "Success"
}
And I Want To Make Like This In PHP How I Can Make It
That is not valid JSON. You can try it out here
Assuming you want valid json output then this will work
$result = [
'Students' => [
['Name' => 'John', 'id' => 123],
['Name' => 'Mickel', 'id' => 4331]
],
'Status' => 'Success'
];
echo json_encode($result);
{
"Students": [{
"Name": "John",
"id": 123
}, {
"Name": "Mickel",
"id": 4331
}],
"Status": "Success"
}
i Have All Data In MYSQL How To Do It