第一种 $ary['a'] 去掉单引号$ary = array('a'=>1);$b = 5;$str = "fdsfdsf$ary[a]";$str = "fdsfdsf$b";echo $str;第二种 用花括号包起来
$ary = array('a'=>1);$b = 5;$str = "fdsfdsf{$ary['a']}";$str = "fdsfdsf$b";echo $str;