title: php foreach as variable
body: <p>I'd like to use foreach to loop though an array list and add an element to each array.</p>
  
  <pre><code>$tom = array('aa','bb','cc');
  $sally = array('xx','yy','zz');
  
  $myArrays = array('tom','sally');
  
   foreach($myArrays as $arrayName) {
       ${$arrayName}[] = 'newElement';
   }
  </code></pre>
  
  <p>Is the use of ${$arrayName}[] the best way to do this?  Is there another option rather than using curly braces?  It currently works but I'm just wondering if there is a better alternative.</p>
  
  <p>Thanks</p>