Posted by <talthen.z-serwera.o2 on 08/23/05 18:11
Hello,
How to make a variable named after the value of another variable?
I know I can use smth like:
$a="name";
$$a="hey";
and that will produce variable called $name with value "hey". But when I try
something like:
$a="_REQUEST['";
$b="']";
$c=$a."thename".$b;
$$c="thevalue";
echo $c;
foreach ($_REQUEST AS $key=>$val)
echo "$key: $val\n"
Then I have only a printout:
_REQUEST['thename']
How to make this _REQUEST['thename'] a variable name?
Ragards,
Talthen
Navigation:
[Reply to this message]
|