我想$masking_x
充当$masking_y
(即动态插入$radiovalue
但仍充当变量)。
我的代码是
while($field_radio = mysql_fetch_assoc($result_radio)) {
$radiovalue = $field_radio[radiovalue];
echo "Radio value: ".$radiovalue."</br>";
$masking = "field_masking[checkbox_1001_".$radiovalue."]";
$masking_x = '$'.$masking;
$masking_y = "$field_masking[checkbox_1001_2]";
echo "Masking: ".$masking."</br>";
echo "Masking_x: ".$masking_x."</br>";
echo "Masking_y: ".$masking_y."</br>";
die;
我得到以下输出:
Radio value: 2
Masking: field_masking[checkbox_1001_2]
Masking_x: $field_masking[checkbox_1001_2]
Masking_y: 2
任何指导将不胜感激。提前致谢。