title: How to store data inside session array in given format?
body: <pre><code>Category Name
    List A = Rm 20
    List B = Rm 50
  
  Category Name
    List A = Rm 40
  
  category Name
    List A = Rm 80
    List B = Rm 40
    List C = Rm 25
  </code></pre>
  
  <p>I tried</p>
  
  <pre><code>$_SESSION['info']=array('category'=&gt;$category,'list'=&gt;$list,'rate'=&gt;$rate);
  </code></pre>
  
  <p>But it doesn't display as the format wanted. Can anyone help please?`</p>
  
  <p>EDIT:</p>
  
  <p>I think I didn't elaborate clearly.</p>
  
  <p>The values for item category, list and rate come from user input.</p>
  
  <p>SO I store them in variables like this: </p>
  
  <p>php</p>
  
  <pre><code>$category[]=$_POST['category'];&lt;br/&gt;
  $list[]=$_POST['list'];
  $rate[]=$_POST['rate'];
  </code></pre>
  
  <p>storing in session array like this:</p>
  
  <pre><code>$_SESSION['info']]=array('level'=&gt;$level,'subject'=&gt;$subject2,'rate'=&gt;$rate2);`
  </code></pre>
  
  <p>html</p>
  
  <pre><code>&lt;input type="checkbox" name="category['category name']" id="category" class=category" value="1"&gt;
  
  &lt;input type="checkbox" name="list['category name']" id="list" value="'List id'"&gt;
  
  &lt;input type="textbox" name="rate['List name']" class="rate" value="" id="'List Name'"&gt;
  </code></pre>