Generate php array to use on js
<p>Table:</p>

<pre><code>--------------------
Product  |   Price
--------------------
apples   |  5
oranges  |  6
peaches  |  7
</code></pre>

<p>how can i get rows from table and generate an json array?</p>