SitePoint Sponsor

User Tag List

Results 1 to 3 of 3

Thread: last 30 days

  1. #1
    SitePoint Guru
    Join Date
    Oct 2004
    Location
    uk
    Posts
    853
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    last 30 days

    Hi guys


    How could i via PHP display the last 30 days like this


    30th November
    29th November
    28th November
    27th November
    26th November
    and son for the last 30 days


    Many thanks in advance

  2. #2
    SitePoint Zealot
    Join Date
    Oct 2008
    Posts
    167
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I gather you want to start with yesterday.

    PHP Code:
    <?php
    for($i=1$i <= 30$i++) {
        print(
    date("M d"time() - (60 60 24 $i)) . "\n"); ## 60 seconds in a minute / 60 minutes in an hour / 24 hours in a day
    }
    ?>
    CanisHosting - Web Hosting plans starting at $3.95 per month

  3. #3
    Use The Cloud
    Join Date
    Jan 2006
    Location
    Boise, ID
    Posts
    556
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    PHP Code:
    for ($i 1$i <= 30$i++) {
       echo 
    date('jS F'strtotime("-$i day")) . "\n";

    Last edited by bhanson; Dec 1, 2008 at 15:08. Reason: Whoops, I had it right the first time
    Brad Hanson, Web Applications & Scalability Specialist
    ► Is your website outgrowing its current hosting solution?
    ► PM me for a FREE scalability consult!
    ► USA Based: Available by Phone, Skype, AIM, and E-mail.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •