Variables within variable names
| From: | Jackson Miller | Date: | Thu, 02 May 2002 18:43:51 +0000 |
| Subject: | Variables within variable names | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-95728@lists.php.net to get a copy of this message | ||
I want to do something along the lines of:
$type = "basic";
$$type_user = "jaxn";
echo $basic_user;
and have the output be "jaxn".
I have tried everything I can think of, and I have looked in all my
books.
I know how to:
$type = "basic";
$$type = "jaxn";
echo $basic;
but this won't do what I need. I need the name of the variable to be a
variable plus some.
I can probably reach my goals using arrays, but I just thought I would
ask first.
-Jackson