解析错误:语法错误、意外的“其他”(T_ELSE)扭矩 Web 查看器


Parse error: syntax error, unexpected 'else' (T_ELSE) torque web viewer

你能告诉我为什么会发生这个错误吗?

( !解析错误:语法错误,意外的"{",期望在第 498 行的 C:''wamp''www''torque''web''session.php 中的"("

<!-- Data Summary Block -->
    <h4>Data Summary</h4>
    <div class="row center-block">
<?php if ($setZoomManually === 0) { ?>
      <!-- 2015.07.22 - edit by surfrock66 - Don't display anything if no variables are set (default) -->
<?php   if ( $var1 <> "" ) { ?>
      <div class="table-responsive">
        <table class="table">
          <thead>
            <tr>
              <th>Name</th>
              <th>Min/Max</th>
              <th>25th Pcnt</th>
              <th>75th Pcnt</th>
              <th>Mean</th>
              <th>Sparkline</th>
            </tr>
          </thead>
          <!-- 2015.08.05 - Edit by surfrock66 - Code to plot unlimited variables -->
          <tbody>
<?php       $i=1;
        while ( isset(${'var' . $i }) ) { ?>
            <tr>
              <td><strong><?php echo substr(${'v' . $i . '_label'}, 1, -1); ?></strong></td>
              <td><?php echo ${'min' . $i}.'/'.${'max' . $i}; ?></td>
              <td><?php echo ${'pcnt25data' . $i}; ?></td>
              <td><?php echo ${'pcnt75data' . $i}; ?></td>
              <td><?php echo ${'avg' . $i}; ?></td>
              <td><span class="line"><?php echo ${'sparkdata' . $i}; ?></span></td>
            </tr>
<?php       $i = $i + 1; } ?>
          </tbody>
        </table>
      </div>
<?php   } else { ?>
      <div align="center" style="padding-top:10px;">
        <h5><span class="label label-warning">No Variables Selected to Plot!</span></h5>
      </div>
<?      } ?>
<?php } else { ?>    <!-- here is the line of the unknown error -->
      <div align="center" style="padding-top:5px;">
        <h5><span class="label label-warning">Select a session first!</span></h5>
      </div>
<?php } ?>
    </div><br />

我正在尝试将此代码放入我的网络服务器以查看我的汽车的数据日志,但它无法正常工作。

以下是github和econpy上的surfrock网页的链接:

  • 冲浪摇滚
  • 经济性

该代码的最新版本来自surfrock,但代码最初是由econpy制作的。

这是

解析错误,很明显您正在使用意外的括号{

您可以定义此变量:

${'var' . $i }

$var . $i 

请注意,这只是一个示例,您需要更改所有变量,如上所述。