json encoding using php
<p>i am new to JSON and i have e datas returning form db 
eg</p>

<pre><code>example
   example1
   example2
sample
   sample1
   sample 2
</code></pre>

<p>like this i need to convert it to json like this <code>
 {'title':'Heavy Metal', 'results': [
        ['/metal/1', 'Disturbed - The Game', 'icons/metal.png'],
        ['/metal/2', 'Marilyn Manson - The Beautiful People', 'icons/metal.png'],
        ['/metal/3', 'Soil - 2 Skins', 'icons/metal.png'],
        ['/metal/4', 'Alestorm - Wenches &amp; Mead', 'icons/metal.png']
    ]},
    {'title':'Pop', 'results':[
        ['/pop/1', 'Michael Jackson - Bad', 'icons/pop.png'],
        ['/pop/2', 'Britney Spears - If U Seek Amy', 'icons/pop.png'],
        ['/pop/3', 'Take That - Relight My Fire', 'icons/pop.png'],
        ['/pop/4', 'Rick Astley - Never Gonna Give You Up', 'icons/pop.png']
    ]},
</code>
if i use json_encode simply i am getting "example","example1"
etc how can i attain this format.</p>
