On Mon, 2003-12-22 at 13:09, John W. Holmes wrote:
> Carey Baird wrote:
> > Hey,
> >
> > I have stored the name of a function as a variable. I have then passed the
> > variable to another function as follows:
> >
> > //put function name in a variable
> > $contentfunction = ânewsadmincontent()â;
>
> Take off the parenthesis...
>
> $contentfunction = 'newsadmincontent';
>
> To call the function, you simply use:
>
> $contentfunction();
>
> Which will call the "newsadmincontent" function.
>
>
> $contentfunction = 'newsadmincontent';
>
> html_function($contentfunction);
>
> function html_function($func_name)
> {
> echo "You requested to execute the function: $func_name.";
> echo 'The output of the function is: ' . $func_name();
> }
Nicely explained!
Please disregard my earlier suggestions. Typing too fast and not paying
enough attention. I'll go sit in the corner now =)
- Brad
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php