title: create json array in codeigniter
body: <p>hi i want to create a json array in codeigniter of the following format . correct me if i am wrong .</p>
  
  <pre><code>// my json format
  $data={"records":[{"name1":[{"id1":"value","subject","subname"},{"id2":"value","subject2","subname"},{"id3":"value","subject3","subname"},{"id4":"value","subject4","subname"}]},
  {"name2":[{"id1":"value","subject","subname"},{"id2":"value","subject2","subname"},{"id3":"value","subject3","subname"},{"id4":"value","subject4","subname"}]}; 
  </code></pre>
  
  <p>i am trying to create it in php using codeigniter ..... really need your help</p>