如果数组不为空(并且其中有值),那么我想显示表格。
但如果它为空,那么我根本不想显示任何表格代码。
使用向页面附加页脚的 MVC 框架。
避免以下陈述的最佳方法是什么:
<?php 
  if ($users) {
    echo '<table id="tha_table" cellpadding="0" cellspacing="0" width="100%">
            <thead>
              <tr>
                <th>First Name</th>
                <th>Last Name</th>
                <th>Email</th>
             </tr>
          </thead>
         <tbody>';
  } ?>
而且,不想再做一次测试来添加表格页脚。