Push associated variables into array in PHP
<p>I have a loop and each time the loop runs I need to add two variables to an array. What I am trying right now is:</p>

<pre><code>$attach_array['outline'] = array();

foreach ($_POST['attachment'] as $key =&gt; $value) {
  $attachmentName        = $value['name'];
  $path                  = "1";
  $name                  = "alsdkjf";
  $attach_array['outline']['path']=$path;
  $attach_array['outline']['name']=$name;
}
</code></pre>

<p>Then later in the script I try to get these values out for PHPMAILER:</p>

<pre><code>foreach ($attach_array['outline'] as $key =&gt; $value) {
   $mail-&gt;AddAttachment($value['path'], $value['name']);
}
</code></pre>

<p>This and other attempts are not working so I'm hoping for some help on putting $name and $path into an array in my first loop to use later.</p>
