How Create Function with Array Arguments PHP
<p>Simple question...</p>

<p>wanna create something like this:</p>

<pre><code>$args = array(
  'post_type' =&gt; 'posts',
  'limit' =&gt; 5,
  'cat' =&gt; 'news'
);
</code></pre>

<p>Then, a function that can actually get these 'keys'... like:</p>

<pre><code>function get_posts($args) {

    $post_type = $args['post_type'];
    $limit = $args['limit'];
    $cat = $args['cat'];

    $sql = mysql_query("SELECT * FROM posts WHERE posttype='$post_type'  .... ");

    // other code...
}
</code></pre>

<p>how can i?</p>

<p>Sorry for bad english and thanks in advance.</p>
