 <p>If you are using php 5.6+, you can use the <code>...</code> operator to unpack an array.</p> <p>In your example:</p> <pre><code>$stmt-&gt;bind_param( $type, ...$values ) </code></pre> <p>See example #14 in the <a href="http://php.net/manual/en/functions.arguments.php#example-145" rel="nofollow noreferrer">manual</a>.</p>