I'm building a REST API and I don't know how to echo several values from one column, I want to echo several values from one single column to a JSON array like the example below. The column will be used to store the usernames a users friends. How do I echo this as the example below and how do I store it in the mysql using PHP?
{
"friends":[
"tim",
"jesper",
"wexx"
]
}