Calling a function with variable number of parameters?
<p>In regard to my question <a href="http://stackoverflow.com/questions/4103729/how-do-i-create-a-parameter-list-for-a-function">here</a>, <a href="http://stackoverflow.com/users/220819/jacob-relkin">Jacob Relkin</a> suggested a great solution of using <a href="http://php.net/call_user_func_array" rel="nofollow">call_user_func_array</a>. That solved my problem but now I am really curious on how to do this in the absence of this function to achieve what I wanted in my original question which is below for reference:</p>

<p><strong><a href="http://stackoverflow.com/questions/4103729/how-do-i-create-a-parameter-list-for-a-function">Original Question:</a></strong> </p>

<p>I am creating an array of arrays in the following way:</p>

<pre><code>$final_array = array();
for($i = 0; $i &lt; count($elements); $i++) {
    for($j = 0; $j &lt; count($elements); $j++) {
        if($i!=$j)
            $final_array[] = array_intersect($elements[$i], $elements[$j]);
    }
}
</code></pre>

<p>I am trying to find out the list of elements that occur in all the arrays inside the <code>$final_array</code> variable. So I was wondering how to pass this to <code>array_intersect</code> function. Can someone tell me how to construct args using <code>$final_array[0], $final_array[1], ... $final_array[end_value]</code> for <code>array_intersect</code>? Or if there is a better approach for this, that would be great too.</p>

<p>I am looking for a way to construct the following:</p>

<p><code>array_intersect($final_array[0], $final_array[1], $final_array[2], ...)</code></p>
