title: Only returns an array value. Array inside Foreach
body: <p>I have this script for upload images, and I upload several images and get only one value:</p>
  
  <p><strong>In PHP/Laravel:</strong>    </p>
  
  <pre><code>if ($request-&gt;hasFile('files')) {
          $images = $request-&gt;file('files');
          $array=[];
          foreach($images as $key =&gt; $image) {
              $filename = rand(1,99).'nameimage.'.$image-&gt;getClientOriginalExtension();
              $array[] = $filename;
                  //upload images
          }
      return response()-&gt;json($array);
      }
  </code></pre>
  
  <p><strong>In script:</strong></p>
  
  <pre><code>$.each(response, function (k,v){
      console.log('Position: '+k+'. Value: '+v);
  });
  </code></pre>
  
  <p>Result, for example: 'Position: 0. Value: 76nameimage.jpg ,
  Why?</p>