I am using php to fetch data from mysql database and json encoding the fetched output
json_encode($data)
The resultant data is in the form:
[
{
name: "aaa"
},
{
name: "bbb"
}
]
I want to put this into a bigger json object and output in the following format in the web browser:
{
content:[
{
name: "aaa"
},
{
name: "bbb"
}
]
}
How do i do this using php?