看一下下面的代碼:爲什麼複雜的語法會給出錯誤?
<?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