PHP中的字符串大括号何谓{ }(大括号)用PHP中的字符串字面值表示?
3 回答
函数式编程
TA贡献1807条经验 获得超9个赞
<?php
$a = '12345';// This works:
echo "qwe{$a}rty"; // qwe12345rty, using braces
echo "qwe" . $a . "rty"; // qwe12345rty, concatenation used// Does not work:
echo 'qwe{$a}rty'; // qwe{$a}rty, single quotes are not parsed
echo "qwe$arty"; // qwe, because $a became $arty, which is undefined?>
MM们
TA贡献1886条经验 获得超2个赞
$number = 4;print "You have the {$number}th edition book";//output: "You have the 4th edition book";$numberth
- 3 回答
- 0 关注
- 749 浏览
添加回答
举报
0/150
提交
取消
