Here is my json array: Updated
{
"Title": "Limitless",
"Year": "2011",
"Rated": "PG-13",
"Released": "2011-03-18",
"Runtime": 105,
"Actors": [
"Bradley Cooper",
"Robert De Niro",
"Abbie Cornish",
"Andrew Howard"
]
}
Here is my php return:
return response()->json($movie);
The Jquery:
$("#stars").val(data.Actors); //Nothing fancy about this. Just outputting data to an input field.
Result:
Bradley Cooper,Robert De Niro,Abbie Cornish,Andrew Howard
Why are there no spaces in between the names/comma's? Is there a way to achieve this without/with regex? Or is it a parsing error?