Posted by Mike Collins on 08/23/06 20:05
On Tue, 22 Aug 2006 17:04:31 +0100, "MS" <MS@nospam.com> 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?
>
>Can you create something like
>$sel_$varname
>to create a variable called
>$sel_test
I don't know if this has any application to what you're doing but this
snippet may be of interest.
Trying to build a dynamic label like this fails:
$label = 'p' .
$srcnumber .
'_label';
But do this:
$label=${'p' . $srcnumber . '_label'};
Get this:
$label = $p0_label;
Navigation:
[Reply to this message]
|