Re: a value of variable as a name of variable
| From: | Andrew Elliston | Date: | Wed, 15 Nov 2000 14:32:48 +0000 |
| Subject: | Re: a value of variable as a name of variable | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-25439@lists.php.net to get a copy of this message | ||
I'm not sure if I know the cause of your problem, but based on the syntax of what you provided
in your email, you need to do this instead:
$quality[1] = "weight";
$vl_hod = $quality[1];
echo $vl_hod;
This will produce an output like:
weight
Your mistake was including $quality[1] in quotes, which tells PHP it's a string, not a variable
or array.
Hope this helps,
Andrew Elliston
> I have variable with this value:
> $quality[1]="weight";
> $vl_hod="$quality[1]";
>
> And I want use the value(!!) of variable $vl_hod as a name of
> variable for the next use. Is it possible to do it?
>
> For example:
> ???echo $vl_hod;????
> I want that the output of "echo" was the value "weight" and
> no the value "$quality[1]".
------------------------------------------------
Drew's Pad
<http://www.elliston.net/drew/>
------------------------------------------------