Have a look at the $$ syntax as opposed to just $.
-Original Message-
From: Brandon Orther [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, February 13, 2001 4:07 PM
To: PHP User Group
Subject: [PHP] Using a variable in a variable
Hello,
Is there a way to use a variable in the middle
Why not just use an array?
$testtext[1] = "value1" ;
$testtext[2] = "value2" ;
etc..
--
Sam Masiello
Systems Analyst
Chek.Com
(716) 853-1362 x289
[EMAIL PROTECTED]
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?
Brandon Orther wrote:
$test($i)text = "$i";
^^--I want this variable to get bigger
Try this:
$test{$i}text = $i;
(I'm not sure if this actually works)
or
$varname = 'test'.$i.'text';
$$varname = $i;
regards
Wagner
--
Three may keep a secret, if two of them are
Often people try to do that ... but I also know that, array variables were
invented exactly for doing this kind of jobs.
Try to implement Arrays more often..
www.php.net/array
Cheers,
Maxim Maletsky
-Original Message-
From: Brandon Orther [mailto:[EMAIL PROTECTED]]
Sent: Wednesday,
I need to simulate this effect: $array[$i] or \$something . $i, and have
it
return $checkbox1 $checkbox2 etc. on up in a while loop.
Just doing it doesn't seem to work, but does anyone know of any work
arounds? Or just the keyword I should be looking for to search the
manual?
You could be
5 matches
Mail list logo