indirectly call function?

From: Date: Sun, 25 Mar 2001 00:16:42 +0000
Subject: indirectly call function?
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-45460@lists.php.net to get a copy of this message
hi all, I'm trying to change which function is called at runtime: e.g. page1.php: include "functions_def.inc.php"; //contains definition for mod_news() $module = "mod_news()"; //for example - gets assigned by case statement include page2.inc.php page2.inc.php: <?php echo $module; ?> the page shows "mod_news()" instead of calling my function :( It works if I use <?php echo mod_news(); ?> but not if I'm trying to hold the function name in the variable. I've tried <?php echo $module; ?> <?php eval $module; ?> <?php print $module; ?> all to no avail. any ideas? tks! jaxon

« previous php.general (#45460) next »