title: Php append value to an exsisting array
body: <p>Hi I need to add some value-key pair to an array which is the output of mysql query. Below is the code,</p>
  
  <pre><code> $query = "select TITLE,DESCRIPTION from  TABLE where ID='1234'";
   $result  = mysqli_query($conn, $query);
  
   $numrows = mysqli_num_rows($result);
   if($numrows&gt;0)
   {
      while($row = mysqli_fetch_array($result, MYSQLI_ASSOC)) {
      $myArray[] = $row;
   }
  }
  
  echo json_encode($myArray);
  </code></pre>
  
  <p>Giving me the result like </p>
  
  <pre><code>[{"TITLE":"Special","DESCRIPTION":"This is DESCRIPTION."}] 
  </code></pre>
  
  <p>Now I need to to add an another key-value pair to generate the json output like,</p>
  
  <pre><code>[{"TITLE":"Special","DESCRIPTION":"This is DESCRIPTION.","URL":"imgname.jpg"}] 
  </code></pre>
  
  <p>So I added the code</p>
  
  <pre><code>$myArray["URL"]="imgname.jpg";
  echo json_encode($myArray);
  </code></pre>
  
  <p>But giving me the output like, </p>
  
  <pre><code>{"0":{"TITLE":"Chef Special","DESCRIPTION":"Grilled Salmon and crab."},"URL":"imgname.jpg"} 
  </code></pre>
  
  <p>Is there anything wrong with above code.</p>