title: passing multiple arguments to function php
body: <p>Apologies for the newbie question but i have a function that takes two parameters one is an array one is a variable <code>function createList($array, $var) {}</code>. I have another function which calls createList with only one parameter, the $var, <code>doSomething($var);</code> it does not contain a local copy of the array. How can I just pass in one parameter to a function which expects two in PHP?</p>
  
  <h2>attempt at solution :</h2>
  
  <pre><code>function createList (array $args = array()) {
      //how do i define the array without iterating through it?
   $args += $array; 
   $args += $var;
  
  
  }
  </code></pre>