p2p.wrox.com Forums

Need to download code?

View our list of code downloads.


  Return to Index  

beginning_php thread: ┐Possible to send code as a parameter and execute it w/in a fcn?


Message #1 by "Trey Carroll" <treycarroll@y...> on Mon, 21 Oct 2002 21:33:31
I would like to send in a piece of code as an argument to a function and 
have the function execute it.  How would I go about this?

EX:
<?

$bar="if( $X == $Y) {echo 'foo!';}";

foo($bar,$X,$Y)
   {
    somefunction($bar);
   }

foo($bar,1,1);
?>

  Return to Index