Posted by Rik on 08/22/06 16:37
MS wrote:
> I saw on the news group a little while back somebody asking about
> $$foo type variables.
>
> I didn;t pay much attention then but I now have reason to use it.
>
> Can somebody point me to the page on php.net that discusses the use
> and how to build such variables.
>
> $varname = "test";
>
> $$varname == $test // is this true?
Indeed.
> Can you create something like
> $sel_$varname
> to create a variable called
> $sel_test
Hmmz, I think that will work.You can solve ambuguity problems by {}.
So $sel_{$varname}_foo == $sel_test_foo
http://nl2.php.net/manual/en/language.variables.variable.php
Grtz,
--
Rik Wasmus
Navigation:
[Reply to this message]
|