你会看到如下的结果:
引用
123123123
Notice: Use of undefined constant test - assumed 'test' in /var/www/html/phpcrm/testpages/variables.php on line 6
123_
Notice: Use of undefined constant test - assumed 'test' in /var/www/html/phpcrm/testpages/variables.php on line 7
123
这说明什么?
1、可接受的写法
从输出结果中“123123123”,表明前面三行的echo语句都是正常的:
[U]复制代码[/U] 代码如下:
echo $test;
echo "${test}";
echo "{$test}";