title: Array for each array row PHP
body: <p>I have an <code>array</code> with name <code>$items</code> like this:</p>
  
  <pre><code>array(2) { 
  
  [0]=&gt; array(8) { ["item_regel"]=&gt; int(0) ["item_id"]=&gt; string(2) "82" ["item_naam"]=&gt; string(21) "Bureauschermen staand" ["item_uitvoering"]=&gt; string(12) "100 x 200 cm" ["item_afmeting"]=&gt; NULL ["item_kleur"]=&gt; string(11) "Transparant" ["item_aantal"]=&gt; string(1) "2" ["item_opmerking"]=&gt; string(18) "Ik wil mijn logo 2" } 
  
  [1]=&gt; array(8) { ["item_regel"]=&gt; int(1) ["item_id"]=&gt; string(3) "226" ["item_naam"]=&gt; string(33) "Instructieborden Dibond aluminium" ["item_uitvoering"]=&gt; string(10) "50 x 50 cm" ["item_afmeting"]=&gt; NULL ["item_kleur"]=&gt; string(5) "Blauw" ["item_aantal"]=&gt; string(1) "2" ["item_opmerking"]=&gt; string(4) "test" } 
  
  }
  </code></pre>
  
  <p>I found this code to prefill a gravity form list field:</p>
  
  <pre><code>add_filter( 'gform_field_value_list_one', 'itsg_prefill_list_one' );
  function itsg_prefill_list_one( $value ) {
      $list_array = array(
          //List row
          array(
              "Product" =&gt; "Product",
              "Afmeting" =&gt; "Good",
              "Uitvoering" =&gt; "Product",
              "Kleur" =&gt; "Product",
              "Aantal" =&gt; "Product",
              "Opmerking" =&gt; "Product",
          ),
          //List row
          array(
              "Product" =&gt; "Product",
              "Afmeting" =&gt; "Good",
              "Uitvoering" =&gt; "Product",
              "Kleur" =&gt; "Product",
              "Aantal" =&gt; "Product",
              "Opmerking" =&gt; "Product",
          ),
      );
      return $list_array;
  }
  </code></pre>
  
  <p>Now this <code>function</code> is filled with fixed <code>values</code>. I want to do a <code>'List row'</code> <code>foreach</code> row inside the <code>array</code> above.</p>
  
  <p>I tried this but it won't work:</p>
  
  <pre><code>add_filter( 'gform_field_value_list_one', 'itsg_prefill_list_one' );
  function itsg_prefill_list_one( $value ) {
  $items = $_SESSION["wishlist"];
      $list_array = array(
       foreach ($items as $keys =&gt; $values) {
         array(
              "Product" =&gt; $values["item_naam"],
              "Afmeting" =&gt; $values["item_afmeting"],
              "Uitvoering" =&gt; $values["item_uitvoering"],
              "Kleur" =&gt; $values["item_kleur"],
              "Aantal" =&gt; $values["item_aantal"],
              "Opmerking" =&gt; $values["item_opmerking"],
          ),
       }
  );
      return $list_array;
  }
  </code></pre>