I'm pretty sure that what I'm doing is legal; however, I'm not getting the result I'm expecting. I'd be happy to find out that I'm referencing this incorrectly, but I can't tell.
$reqCount=8;
$reqType="CP3";
$count = "reqCount";
$type = "reqType";
$req = "cardReq";
print "\$\$count = ".$$count."<BR>\n";
print "\$\$type= ".$$type."<BR>\n";
$$req['count'] = $$count;
$$req['card'] = $$type;
var_dump($$req['count']);
var_dump($$req['card']);
print "cardReq['card'] = ". $cardReq['card'] . "<BR>\n";
print "cardReq['count'] = ". $cardReq['count'] . "<BR>\n";
The result I'm getting is:
$$count = 8<BR>
$$type= CP3<BR>
string(3) "CP3"
string(3) "CP3"
cardReq['card'] = <BR>
cardReq['count'] = <BR>
If you were to see me now, you'd practically SEE the question marks written on my face.
Thanks in advance!
-Me.