title: Add items on array using loop
body: <p>I want to add item to my array using loop. But i can't make it right.</p>
  
  <p>I tried this code, and it can't gave me the Format/Output i want.</p>
  
  <pre><code>$img_arr[]= "";
  foreach ($images as $image) { 
      $img_arr['src'][] .=  $image['src'];
  }
  </code></pre>
  
  <p>i want this kind of output.</p>
  
  <pre><code>array (
      'src' =&gt; 'https://example.com/wp-content/uploads/2019/07/3.jpg',
    ),
    array (
      'src' =&gt; 'https://example.com/wp-content/uploads/2019/07/2-1.jpg',
    ),
    array (
      'src' =&gt; 'https://example.com/wp-content/uploads/2019/07/3.jpg',
    ),
    array (
      'src' =&gt; 'https://example.com/wp-content/uploads/2019/07/1-1.jpg',
    ),
    array (
      'src' =&gt; 'https://example.com/wp-content/uploads/2019/07/4-1.jpg',
    )
  </code></pre>