title: php foreach loop: parsing values of a form into array
body: <p>I'm working on a CakePHP project. I want to merge the values of <code>$value</code> into a string/array so I can later merge it with the string &quot;TESTING&quot; then implode the outcome to a single string without spaces!!!</p>
  <pre><code>&lt;?php 
  $merge=&quot;TESTING&quot;; ?&gt;
  &lt;form method=&quot;post&quot; name=&quot;payment_form&quot; action=&quot;&lt;?php echo $action; ?&gt;&quot;&gt;
  &lt;?php foreach ($fields as $name =&gt; $value): ?&gt;
  &lt;input type=&quot;hidden&quot; name=&quot;&lt;?php echo $name; ?&gt;&quot; value=&quot;&lt;?php echo $value; ?&gt;&quot;/&gt;
  &lt;?php endforeach; ?&gt;
  &lt;p&gt;some text&lt;input type=&quot;submit&quot; value=&quot;submit&quot;/&gt;&lt;/p&gt;    
  &lt;/form&gt;
  </code></pre>
  <p>How can this be done? Thanks in advance.
  EG: Please I want to keep the code as is. Meaning no <code>for(var i=0;i++...)</code> loops</p>
  <h3>Example</h3>
  <p>Let's say the values of the form are <strong>1 2 3 productnr</strong> the outcome should be a string <strong>123productnrTESTING</strong> no spaces just a string.</p>
  <p>Well i wanted to send that data to a bank gateway to be processed. So it goes like this
  1)Bank has sent me a string (The one called TESTING)
  2)I print my form data (with the above code)
  3) I need to send that data + the string provided into an imploded string to the bank gateway. Hope that clarifies some things :)</p>