I have an array that looks like this:
Array (
[1] => Laravel
[2] => Volta
[3] => Web
[4] => Design
[5] => Development
)
Now I want to convert this array to a string that has to look like this
data: [{id: 1, text: 'Laravel'},{id: 2, text: 'Volta'},{id: 3, text: 'Web'},...],
id:andtext:. And the shallow answers are incorrect when it comes to the output syntax (unquoted keys), but presumably so are you.