Converting my php array to string
<p>I have an array $tagsdata that looks like this when i print it out</p>

<pre><code>Array ( [1] =&gt; Laravel [2] =&gt; Volta [3] =&gt; Web [4] =&gt; Design [5] =&gt; Development )
</code></pre>

<p>Now i wan't to convert this array to a string that has to look like this</p>

<pre><code>data: [{id: 1, text: 'Laravel'},{id: 2, text: 'Volta'},{id: 3, text: 'Web'},...],
</code></pre>

<p>for in my javascript i have no clue how to do this</p>
