On Wednesday 04 August 2004 11:50, [EMAIL PROTECTED] offered
up the following tid-bit of information :
> I'm trying to create a links page, and I wanna filter by category.
> Anyhoo,
> What I need to do, is have one block of code that I repeat ad neaseum,
> based on each category, so if I adda new
* Thus wrote [EMAIL PROTECTED]:
> I'm trying to create a links page, and I wanna filter by category.
> Anyhoo,
> What I need to do, is have one block of code that I repeat ad neaseum, based on each
> category, so if I adda new category, I don't need to add new code...
>
> All good so far.
> So
I am a monkey...
I had me angle bracket the wrong way round... what a stoner...!
"Chris Boget" <[EMAIL PROTECTED]>
22/12/2003 15:04
To
<[EMAIL PROTECTED]>
cc
<[EMAIL PROTECTED]>
Subject
Re: [PHP] combining two variables to make one???
> Doesn't
> Doesn't work for me though...?
Which isn't working?
This:
${"$options{$i}"} = "result $i";
or this:
$i = 1;
while ($i >= 3) {
$varName = $options . $i;
${$varName} = "result $i";
}
> What do the '{' mean when declaring the variable?
I can't remember where it is in the documentati
Cheers...
Doesn't work for me though...?
What do the '{' mean when declaring the variable?
"Chris Boget" <[EMAIL PROTECTED]>
22/12/2003 14:16
To
<[EMAIL PROTECTED]>, <[EMAIL PROTECTED]>
cc
Subject
Re: [PHP] combining two variables to ma
> $i = 1;
> while ($i >= 3) {
> $options$i = "result $i";
> }
> ?>
You want this:
${"$options{$i}"} = "result $i";
For the sake of clarity I typically do something like the following:
$i = 1;
while ($i >= 3) {
$varName = $options . $i;
${$varName} = "result $i";
}
Chris
--
PHP Genera
6 matches
Mail list logo