$result = $$function

From: Date: Sat, 24 Feb 2001 12:30:03 +0000
Subject: $result = $$function
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-41476@lists.php.net to get a copy of this message
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

« previous php.general (#41476) next »