Smarty 数组排序

WBOY
Release: 2016-06-20 12:26:37
Original
1176 people have browsed it

如何用smarty按时间从小到大排序?

<{$time}>array(    "11:45" => array("title1"=>"1", "title2"=>"2"),    "13:00" => array("title1"=>"7", "title2"=>"22"),    "09:45" => array("title1"=>"2", "title2"=>"32"),    "10:30" => array("title1"=>"6", "title2"=>"52"))
Copy after login



回复讨论(解决方案)

排好序再发送给smarty  或者在smarty里面加载php标签进行排序

为何不用php排序好了再传给smarty??
一句代码的事
ksort($arr);

排好序再发送给smarty  或者在smarty里面加载php标签进行排序



为何不用php排序好了再传给smarty??
一句代码的事
ksort($arr);



我在smarty那修改的话,就不用看之前同事在php写的代码
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template