I always find it's eaiser to deal with simple problems like this in smaller scripts.. removing the unneeded html.. such as
<?php
$foo = "bar";
$session['text_$foo_text'] = "value";
echo "<pre>";
print_r($session);
?>
which has an output of
Array
(
[text_[B]$foo[/B]_text] => value
)
notice $foo isn't the value "bar", but instead the variable name.
so, to add a variable to a variables array, you use a [..whatever the "." is called] just like you would in a normal string:
<?php
$foo = "bar";
$session['text_'.$foo.'_text'] = "value"; // <<<<
echo "<pre>";
print_r($session);
?>
which has an output of
Array
(
[text_[B]bar[/B]_text] => value
)
notice the value of $foo is the actual value "bar", and not the variable name