From: "David Otton" <[EMAIL PROTECTED]> > >From: "Ian Truelsen" <[EMAIL PROTECTED]> > > > >> What I want to do is to call a function from within a function, but pass > >> the secondary function name through the first function. Like this: > >> > >> function1(function2) > >> > >> Then call function2 from within function1. Unfortunately, I have been > >> unable to figure out the proper syntax for calling the second function. > > > >$function = 'print'; > >$function('you mean like this??'); > > Does that snippet run for you, as-is?
Of course not... lol...sorry... But this does: <?php function myfunction($data) { echo $data; } $function = 'myfunction'; $function('you mean like this??'); ?> $function must be a user defined function, I guess. Same as with your example, you could just use $f(); instead of call_user_func ($f); Just depends which is clearer to you... ---John Holmes... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php