title: Make a JSON file with multiple same format using PHP
body: <p>Fist of all i would like to tell I am a beginner for JSON. I would like to know how to make a following format JSON using PHP. I think I want to use loop function.  </p>
  
  <p>Example:</p>
  
  <pre><code>[ { "id" : "1", "name" : "test1" },
    { "id" : "2", "name" : "test2" },
    { "id" : "3", "name" : "test3" },
    { "id" : "4", "name" : "test4" },
    { "id" : "5", "name" : "test5" } ]
  </code></pre>
  
  <p>In my PHP file have <code>$VALUE</code> variable in different places. I want know id and name values store method to make this JSON. I can not use $VALUE1, $VALUE2 etc.</p>
  
  <p>Some places have following $VALUE variable with some data. is it method right to make this JSON</p>
  
  <pre><code>$VALUE = array("id" =&gt; "1", "name" =&gt; "test1");
  
  $VALUE = array("id" =&gt; "3", "name" =&gt; "test3");
  </code></pre>