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();
}

--
---John Holmes...

Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/

php|architect: The Magazine for PHP Professionals – www.phparch.com

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Reply via email to