Re: Variable Problem

From: Date: Sat, 19 Jan 2002 03:42:05 +0000
Subject: Re: Variable Problem
Groups: php.general 
Request: Send a blank email to php-general+get-81193@lists.php.net to get a copy of this message
Hello. >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 How about the below. <? $i=10; ${"result$i"}="test"; echo $result10; ?> or <? $i=10; ${'result'.$i}="test"; echo $result10; ?> Cheers :-) ----------------------------------- K.Tomono

« previous php.general (#81193) next »