, February 14, 2001 6:07 AM
To: PHP User Group
Subject: [PHP] Using a variable in a variable
Hello,
Is there a way to use a variable in the middle of a variable?
## START EXAMPLE ##
## END EXAMPLE ##
$test($i)text = "$i";
^^--I want this variable to get bi
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
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?
>
your better using arrays if you can though.
--
Chris Lee
Mediawaveonline.com
em. [EMAIL PROTECTED]
ph. 250.377.1095
ph. 250.376.2690
fx. 250.554.1120
""Brandon Orther"" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Hello,
>
> Is there a way to use a
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 th
Hello,
Is there a way to use a variable in the middle of a variable?
## START EXAMPLE ##
## 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 cor
> 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
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?
I have a form bein
8 matches
Mail list logo