How do I use the date (UNIXtimestamp) to separate the article list?

Source: Internet
Author: User
How do I use the date (UNIXtimestamp) to separate the article list? News_table
Id (PK)
Title
Time (INT 10) (UNIX timestamp format)
Content

How to achieve the following format

News...
Title title

Title title

Title title

======================================
News...
Title title

Title title
========================================

News...
Title title

Title title



Should I use SMARTY in SMAERT or php?

Please provide some ideas


Reply to discussion (solution)

Generate a string in the required format through php processing and display it through smarty

The processed array:
Array
(
[0] => Array
(
[Id] => 10
[Title] => title... title
[Create_time] = & gt; 1418745763
[Date] => 2014-12-17
)

[1] => Array
(
[Id] => 9
[Title] => title... title
[Create_time] = & gt; 1418745155
[Date] => 2014-12-16
)

[2] => Array
(
[Id] => 8
[Title] => abcabcabc
[Create_time] = & gt; 1418744953
[Date] => 2014-12-16
)

[3] => Array
(
[Id] => 7
[Title] => bbbbbb
[Create_time] = & gt; 1416772786
[Date] => 2014-11-24
)

[4] => Array
(
[Id] => 1
[Title] => aaaaaaa
[Create_time] = & gt; 1415879638
[Date] => 2014-11-13
)
)


How can we create [date] as a 2-dimensional array and then perform a two-layer loop in smarty?

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.