Re: $result = $$function

From: Date: Sat, 24 Feb 2001 14:12:50 +0000
Subject: Re: $result = $$function
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-41481@lists.php.net to get a copy of this message
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: php-general-unsubscribe@lists.php.net For additional commands, e-mail: php-general-help@lists.php.net To contact the list administrators, e-mail: php-list-admin@lists.php.net

« previous php.general (#41481) next »