Hi,
I didn't get why you haven't used this:
switch $var
case something: $result=$build_result(); break;
case somethingelse: $result=$build2(); break;
blah blah blah...
Ahmad
----- Original Message -----
From: Peter Van Dijck
To: php gen list
Sent: Saturday, February 24, 2001 4:00 PM
Subject: [PHP] $result = $$function
Hi,
I'd like to do:
$function = "build_result()";
$result = $$function;
but it doesn't seem to work.
The reason why I think I need it is that I have a generic function, but
within it I have to call another function depending on who called it. I
could build a switch within the generic function deciding which function to
call, but tht seems less elegant, as I'd have to adjust the generic
function every time a new function calls it.
The build_result() function only gets called in certain cases by the
generic function (if it's not cached), so I can't just put it outside fo
the generic function.
Any hints?
Thanks!
Peter
~~~~~~~~~~~~~~~~~~~~~
http://liga1.com ,a weblog on:
- Localisation
- Internationalisation
- Globalisation
- Accessibility
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]