Daragh,
Ok, the problem appears to be that when you
have a variable variable as an array, there
is some ambiguity. If you have an array a,
then $$a[0] could mean
${$a[0]}
or
${$a}[0]
You have to specify which by use of the
curly braces. Now, the problem with what
you are trying to code is that by placing
the array index [0] in the $var variable,
you apparently force the system to use the
first interpretation. If, instead, you say
$var = "chk1";
and then echo ${var}[0], you should get
the value you want. I used this test script,
which you can use to see the behavior:
<?php
$chk1[0] = "This is a first test";
$var = "chk1";
echo "$chk1[0]<BR>$var<BR>" . ${$var}[0];
echo "<P>";
$chk1[0] = "This is a second test";
$var = "chk1[0]";
echo "$chk1[0]<BR>$var<BR>" . ${$var};
?>
Hope this helps.
Michael