When doing string interpolation, "$option[$i]" is the same as $option[$i]. However, "$option$i[$s]" is the same as "$option"."$i[$s]". Since $i isn't an array, the value of $i[$s] is an undefined value.
Perhaps you should be using a two dimensional array:
$option[0][0] = "a";
$option[0][1] = "b";
$option[0][2] = "c";
$option[1][0] = "d";
$option[1][1] = "e";
for($i=0; $i<count($option); $i++)
{
for($j=0; $j<count($option[$i]); $j++)
{
echo $option[$i][$j];
}
}
// Prints "abcde"
Another solution would be to run 2 operations instead of 1:
// This code is untested, prefer to use the other way
$varname = "option_$i";
$value = "$varname[$s]";
Tom Brown
An online Starcraft RPG? Only at
http://www.netnexus.com
p.s. I know this post is late... Got distracted but left the window open!