SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Enthusiast
    Join Date
    Mar 2007
    Posts
    77
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Can anyone help me with this line of code??

    Hi can anyone please tell me exactly what this line of code does. I am a newbie and I am confused. I did a search on google to find a line of php code to specify the date and create an expire date. This line is what I found....

    Code:
    $aexp =  mktime(0,0,0,date(m) + $a1[Duration],date(d),date(Y));
    I was wondering exactly what it does.
    I did take a chance and put it into my script and it says that the (m), (d) and (y) are undefined variables but when i stored this information in the data base it get store in the database like this: 1174719600 as the expire date.

    Can anyone please help me understand this better??

  2. #2
    SitePoint Enthusiast SilkySmooth's Avatar
    Join Date
    May 2003
    Location
    In the PHP Engine :-)
    Posts
    58
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    The line makes a date in the future based on the value of $a1[Duration].

    So for example if $a1[Duration] was equal to 1 then your date would be today + one month.

  3. #3
    SitePoint Addict
    Join Date
    Sep 2006
    Posts
    219
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi,

    The (m), (d) and (y) should be quoted.

    Take a quick look at mktime() and date() in the php manual and you'll work it out pretty easily.

    Dan


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
  •