有人能告诉我我的PHP代码有什么问题吗?

-5 php macos mamp

使用最新版本的MAMP.PHP 500错误说意外"." 在第7行

function get_thumbnail_view_html($thumb) {

$thumb_layout = "";

$thumb_layout = $thumb_layout . '<li class="span3">';
$thumb_layout = $thumb_layout . '<a class="thumbnail" href="' . $thumb["link"] . '">';
$thumb_layout = $thumb_layout . '<img src="' . $thumb["img"] . '" alt="' . $thumb["name"] . '">';
$thumb_layout = $thumb_layout . '<p>' . $thumb["name"] '</p>';
$thumb_layout = $thumb_layout . '<span>' . $thumb["filter"] '</span>';
$thumb_layout = $thumb_layout . "</a>";
$thumb_layout = $thumb_layout . "</li>";

return $thumb_layout;
Run Code Online (Sandbox Code Playgroud)

}

Aus*_*eco 5

看起来你错过了.在几行上连接字符串:

$thumb_layout = $thumb_layout . '<p>' . $thumb["name"] '</p>';
$thumb_layout = $thumb_layout . '<span>' . $thumb["filter"] '</span>';
Run Code Online (Sandbox Code Playgroud)

应该

$thumb_layout = $thumb_layout . '<p>' . $thumb["name"] . '</p>';
$thumb_layout = $thumb_layout . '<span>' . $thumb["filter"] . '</span>';
Run Code Online (Sandbox Code Playgroud)