我无法弄清楚这段代码出了什么问题

时间:2018-09-11 18:13:10

标签: php

运行此代码时,它始终显示: 解析错误:语法错误,第30行上的/opt/lampp/htdocs/japan_top10_09112018/index.php中的文件意外结束

    <?php 
     echo "<title>Top 10 Things to Do in Japan</title>";
     require_once('templates/header.php'); 
   ?>
   <?php
      // Ask teacher: does this code is right to show errors or necessary?
       ini_set('display_errors', 1);
     error_reporting(E_ALL | E_STRICT);
   ?>
  <?php 
     require_once('database/data.php');
  ?>

<div class = "container">
   <h1>Top 10 things to do in Japan</h1>

<?php

foreach($data as $info) {
  print_r($info["Picture"]);
  echo "<hr>";
  // echo '<img src="$info["Picture"]" class="img-thumbnail">';


 ?>

<?php 
require_once('templates/footer.php'); 
?>

第30行是最后一行。

1 个答案:

答案 0 :(得分:-1)

您忘记添加}来关闭foreach