RE: [PHP] Capturing Eval'd things into a variable...
| From: | Ignacio Vazquez-Abrams | Date: | Mon, 27 Nov 2000 20:30:05 +0000 |
| Subject: | RE: [PHP] Capturing Eval'd things into a variable... | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-27449@lists.php.net to get a copy of this message | ||
On Mon, 27 Nov 2000, Roy Nasser wrote:
> I just have one more question... I know that i can do something like:
>
> $Var = "VariableName";
>
> echo $$Var;
>
> and it will be the same as
>
> echo $VariableName;
>
> Now is there a way to do this with a funciton?
>
> Such as:
>
> $Fun = "FunctionName";
> $Fun();
>
> being the same as FunctionName();
>
Yes on both counts.
Additionally, you can say "${"foo".$bar}" and it will be treated as a variable
with the name of "foo" with the value of $bar concatenated to it.
--
Ignacio Vazquez-Abrams <ignacio@openservices.net>