Simple question...
wanna create something like this:
$args = array(
'post_type' => 'posts',
'limit' => 5,
'cat' => 'news'
);
Then, a function that can actually get these 'keys'... like:
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...
}
how can i?
Sorry for bad english and thanks in advance.