|
Posted by lawrence k on 11/17/06 01:58
> I have a function like this:
> function get_articles($cat=1,$numberposts=1);
>
> it can be used:
> get_articles(cat=4&numberposts=6);
> //will display 6 posts from category 6
You mean
get_articles(cat=4, numberposts=6);
yes?
> then I want to use that function within another function, like this:
>
> function display_cat($new_cat=1,$new_num=1,$othercontent="")
> {
> get_articles(cat=$new_cat&numberposts=$new_num)
>
> ......
> }
>
>
> Can I pass function like this ?
I think you mean
get_articles($new_cat, $new_num);
And you're not passing a function, you're passing variables. You can't
pass functions in PHP. You could pass objects, but you don't need to
here.
[Back to original message]
|