Re: Using a variable in a variable
| From: | Sam Masiello | Date: | Tue, 13 Feb 2001 21:08:11 +0000 |
| Subject: | Re: Using a variable in a variable | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-39495@lists.php.net to get a copy of this message | ||
Why not just use an array?
$testtext[1] = "value1" ;
$testtext[2] = "value2" ;
etc..
--
Sam Masiello
Systems Analyst
Chek.Com
(716) 853-1362 x289
smasiello@chekinc.com
On 2001.02.13 16:06:54 -0500 Brandon Orther wrote:
> Hello,
>
> Is there a way to use a variable in the middle of a variable?
>
> ## START EXAMPLE ##
>
> <?
>
> $test1text = "";
> $test2text = "";
> $test3text = "";
>
> $count = 3;
>
> $i = 0;
> do{
>
> $test$itext = "$i";
>
> }while($i < $count);
>
> ?>
>
> ## END EXAMPLE ##
>
>
> $test($i)text = "$i";
> ^^----------------------I want this variable to get bigger while
> the
> loop is going but I can't figure out how to make the $test#text variable
> to
> read it correctly.
>
> I hope someone can understand what I am saying.
>
> Thank you,
>
> --------------------------------------------
> Brandon Orther
> WebIntellects Design/Development Manager
> brandon@webintellects.com
> 800-994-6364
> www.webintellects.com
> --------------------------------------------
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
> For additional commands, e-mail: php-general-help@lists.php.net
> To contact the list administrators, e-mail: php-list-admin@lists.php.net
>