如何按字母顺序排序表中foreach循环的输出:
<table class="list <?php echo $list_class; ?>">
<tr class="table-header">
<?php
if (is_array($columns)):
foreach ($columns as $column):
$column = parse_class($column);
?>
<th class="<?php echo $column['class']; ?>"><?php echo $column['column']; ?></th>
<?php
endforeach;
endif;
if (is_array($actions)):
foreach ($actions as $action): ?>
<th class="action"></th>
<?php
endforeach;
endif;
?>
</tr>
<?php
if (is_array($data['page'])):
foreach ($data['page'] as $item):
foreach($item as $item_member):
if(stripos($item_member, $_POST['term']) !== FALSE):
?>
<tr>
<?php
foreach ($columns as $key => $column):
$key = parse_class($key);
?>
<td class="<?php echo $key['class']; ?>"><a class="cell-link" href="<?php echo $details_link . $item[$details_id_field]; ?>">
<?php
echo (!empty($item[$key['column']])) ? $item[$key['column']] : ' ';
?>
</a></td>
<?php
endforeach;
?>
</tr>
<?php
endif;
endforeach;
endforeach;
endif;
?>
</table>
我正在尝试确保第一列按字母顺序排序。 我可以在第一个循环中应用一些东西吗?感谢