Timestamp for array elements

Discussion in 'PHP' started by khan11, Sep 14, 2007.

  1. #1
    Hello guys!


    I need some help from you...

    I have created an array with many elements like $arrayName = array("a","b","c","d",);

    what i want is to add a timestamp to each of its elements which is shown like this:
    Created on: August 27, 2007 or Created on: August 27, 2007 at 7:23pm


    these timestamps should only show the time when they were created and not the timestamp of all array elements should be same.

    Can i do it? if, then how?
     
    khan11, Sep 14, 2007 IP
  2. nico_swd

    nico_swd Prominent Member

    Messages:
    4,153
    Likes Received:
    344
    Best Answers:
    18
    Trophy Points:
    375
    #2
    Umm...

    The elements are created as soon as this code is being parsed:
    
    $arrayName = array("a","b","c","d",);
    
    PHP:
    Which would take less than a second, and therefore all timestamps would be the same.

    Can you be more specific? Do these values from from a database?
     
    nico_swd, Sep 14, 2007 IP
  3. hamidof

    hamidof Peon

    Messages:
    619
    Likes Received:
    44
    Best Answers:
    0
    Trophy Points:
    0
    #3
    hamidof, Sep 14, 2007 IP
  4. khan11

    khan11 Active Member

    Messages:
    615
    Likes Received:
    15
    Best Answers:
    0
    Trophy Points:
    58
    #4
    sorry hamidof, i couldn't get what u want to explain. I'm new in php :(

    nico_swd, yes sure.. i have no experience in database, i can open my phpmyadmin and you guide me what to do with database to add timestamps to my array elements.

    thanks
     
    khan11, Sep 14, 2007 IP