怎么实现为倒序排列?

2016-07-07 15:22 来源:www.chinab4c.com 作者:ecshop专家

<ul>
<?php $_from = $this->_var['new_articles_2']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }; $this->push_vars('', 'article2');if (count($_from)):
foreach ($_from AS $this->_var['article2']):
?>
<li>
[<a href="<?php echo $this->_var['article2']['cat_url']; ?>"><?php echo $this->_var['article']['cat_name']; ?></a>] <a href="<?php echo $this->_var['article2']['url']; ?>" title="<?php echo htmlspecialchars($this->_var['article2']['title']); ?>"><?php echo sub_str($this->_var['article2']['short_title'],36); ?></a>
</li>
<?php endforeach; endif; unset($_from); ?><?php $this->pop_vars();; ?>
</ul>

回答:
你需要在PHP里面实现倒序 而不是在这里实现.array_reverse