第一种 $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;
本文共 257 字,大约阅读时间需要 1 分钟。
第一种 $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;
转载于:https://www.cnblogs.com/as3lib/p/6625716.html