Re: Variable Problem
| From: | val petruchek | Date: | Fri, 18 Jan 2002 16:50:20 +0000 |
| Subject: | Re: Variable Problem | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-81111@lists.php.net to get a copy of this message | ||
<?php
$i = 10;
eval ("\$result$i=\"test\";");
echo $result10;
?>
Valentin Petruchek (aki Zliy Pes)
http://zliypes.com.ua
mailto:val@zliypes.com.ua
----- Original Message -----
From: <programmer@icecoldgold.com>
To: <php-general@lists.php.net>
Sent: Saturday, January 19, 2002 2:47 AM
Subject: [PHP] Variable Problem
>
>
> How do I combine the following so it is treated as one variable
>
> $i=10
>
> $result$i="test";
>
>
> I want this to be:
>
>
> $result10="test";
>
>
> $i changes so I cannot just put in 10 instead of I.
>
>
> anybody know how i can do that?
>
> TIA
> Randy
>
----------------------------------------------------------------------------
----
> --
> 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