引导表数据url用php填充


bootstrap table data url populate with php

我有一个bottstrap html表:

<table data-toggle="table" data-url="../../scripts/tags/s_displaytags.php"  data-show-refresh="true" data-show-toggle="true" data-show-columns="true" data-search="true" data-select-item-name="toolbar1" data-pagination="true" data-sort-name="TagName" data-sort-order="desc">
<thead>
  <tr>
  <th data-field="SerialNumber" data-sortable="true">Serial #</th>
  <th data-field="TagName" data-sortable="true">Tag Name</th>
  <th data-field="CreatedBy"  data-sortable="true">Created By</th>
  </tr>
</thead>
</table>

我正在尝试使用PHP脚本s_displaytags.PHP来填充它。目前我正在测试它,所以代码是:

<?PHP
$ArrayValue = array();
$ArrayValue['SerialNumber'] = 1; 
$ArrayValue['TagName'] = 'test'; 
$ArrayValue['CreatedBy'] = 50; 
echo json_encode($ArrayValue);
?>

我的HTML页面加载了,但表值没有加载。

我现在没有使用任何函数。它只是一个普通的PHP文件,返回一个编码为JSON的结果行。

所以我刚刚更改了echo json_encode($ArrayValue);以回显json_encode(数组($ArrayValue));它奏效了。