title: Add each variable of a Query String to an array
body: <p><br>
  I have here the following output in a Query String:<br><br>
  <code>add_to_cart.php?product_id=4&amp;product_name=Pizza&amp;quantity=1&amp;additional_id[]=1&amp;additional_quantity[]=3&amp;additional_id[]=4&amp;additional_quantity[]=5</code><br><br>
  I'm trying to set up an array with each of additional IDs and their respective quantities. Each ID corresponds to an additional product in the database in the table <em>additionals</em>, and I need to make a SQL query for each ID to get the price and the name of the additional and then show the price multiplicated with their quantity.<br>
  If I use:</p>
  
  <pre><code>foreach ($_GET['additional_id'] as $value)
  {
      echo "&lt;p&gt;{$value}&lt;/p&gt;";
  }
  </code></pre>
  
  <p>If the output is based in the example Query String above I get:<br>
      <code>1</code><br>
      <code>4</code><br>
  But I need to add each ID with their quantity inside of this array in the file <strong>add_to_cart.php</strong>:</p>
  
  <pre><code>$columns = array
  (
      'product_id_session' =&gt; $product_id_session,
      'product_id' =&gt; $product_id,
      'product_name' =&gt; $product_name,
      'product_price' =&gt; $product_price,
      'quantity' =&gt; $quantity,
      'additional_id' =&gt; //Maybe I need a foreach here or another array to add all the additionals of Query String?
      'additional_quantity' =&gt; //Here too?
      'additional_name' =&gt; //Retrieved from database, like price below
      'additional_price' =&gt; //Like additional_name, I will need to connect to database and get the price of each additional ID present in the Query String
  );
  </code></pre>
  
  <p>I was trying to do something like:<br><br>
  <code>add_to_cart.php?product_id=4&amp;product_name=Pizza&amp;quantity=1&amp;additionals=additional_id[]=1&amp;additional_quantity[]=3&amp;additional_id[]=4&amp;additional_quantity[]=5</code><br><br>
  This can be the right way? Maybe I can create an array with <code>additionals</code> and parse it to the <code>columns</code> array? And how to get the <code>additional_price</code> and <code>additional_name</code> for each additional ID present in Query String by a SQL connection to the table <code>additionals</code>? This is being very complicated for me. I appreciate any help!</p>