相关疑难解决方法(0)

在PHP中使用heredoc语法时遇到麻烦

<?php
        $output = <<< END 
        <table style="display: table;" class="listview rowstyle-rowhighlight" id="resourcegrid">
          <thead>
            <tr>
              <th width="70"></th>
              <th style="-moz-user-select: none;" class="sortable fd-column-0"><a class="fdTableSortTrigger" href="#">Name</a></th>
              <th style="-moz-user-select: none;" class="sortable fd-column-1"><a class="fdTableSortTrigger" href="#">Contributor</a></th>
              <th style="-moz-user-select: none;" class="sortable fd-column-3"><a class="fdTableSortTrigger" href="#">Modified</a></th>
            </tr>
          </thead><tbody>
END;

echo $output;
Run Code Online (Sandbox Code Playgroud)

当我运行它时报告:

Parse error: parse error on line 2
Run Code Online (Sandbox Code Playgroud)

但我没有看到任何异常.

php heredoc

0
推荐指数
1
解决办法
3797
查看次数

标签 统计

heredoc ×1

php ×1