title: Foreach returns only one output
body: <p>Okay so I am stuck here and I know there would be a simple solution, but I can't figure it out. So the thing is that I have a function which creates columns in a database if not exists. I got the function to work but I want to add the functionality in the function of detecting the column type (VARCHAR, INT etc) and creating columns accordingly. I am trying to get this done by <code>gettype</code> keyword. Now, <code>$productData</code> is in array so I need to apply foreach to get them separated and then I get the value type, the problem is that in the end foreach loop, it gives me only string. Where <code>$productData</code> has 4 strings and 1 integer .. </p>
  
  <pre><code>$array       = (array) $productData;
  $arrayValues = array_values( $array );
  $i = 0;
  
  foreach ( $arrayValues as $key =&gt; $value ) {
      $types = array( "id-$i" =&gt; gettype( $value ) );
      $i++;
  }
  var_dump($types);
  </code></pre>
  
  <p>Can somebody help me out there please? </p>
  
  <p>Thanks ..</p>