Re: adding text to a variable name
| From: | Henrik Hansen | Date: | Tue, 01 May 2001 21:28:44 +0000 |
| Subject: | Re: adding text to a variable name | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-51028@lists.php.net to get a copy of this message | ||
Jamie Saunders <webprogramming@jamie-s.co.uk> wrote:
> Hi,
>
> Is it possible to add text onto the end of a variable name?
> e.g. to add the word 'code' onto the variable $field so it would be $fieldcode
Look variable variables up in the manual, I think that would solve
your problem.
example:
$var = "fieldcode";
$$var = "the value";
echo $fieldcode;
more information here:
http://www.php.net/manual/en/language.variables.variable.php
--
Henrik Hansen