PHP

PHP句法规则详解

1.简单句法规则(用花括号界定变量名,适用于PHP所有版本):
$a = 'flower';
echo "She received some $as";
// 无效;字母s会被当成有效的变量名组成元素,但是这里的变量是$a
echo "She received some ${a}s"; // 有效
echo "She received some {$a}s"; // 有效;推荐的使用方法…