看一下下面的代码:为什么复杂的语法会给出错误?
<?php
//The array stores the nodes of a blog entry
$entry = array('title' => "My First Blog Entry",
'author' => "daNullSet",
'date' => "August 10, 2012",
'body' => "This is the bosy of the blog");
echo "The title of the blog entry is ".{$entry['title']};
?>
它提供了以下错误我。
Parse error: syntax error, unexpected '{' in C:\xampp\htdocs\php-blog\simple-blog\array-test.php on line 7
如果我在上面的代码中删除在echo语句中引入复杂语法的大括号,则错误消失。请帮我调试上面的代码。 谢谢!
为什么是得到downvoted? – 2012-08-10 06:29:41
有礼貌地提及downvote的原因。 – diEcho 2012-08-10 06:31:00
我没投你一票,但显然你的第二个代码会产生'注意:使用未定义的常量标题 - 假设'标题'在' – Baba 2012-08-10 06:32:42