SitePoint Sponsor

User Tag List

Results 1 to 7 of 7
  1. #1
    SitePoint Addict
    Join Date
    Jul 2010
    Posts
    247
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    add code for today date in my php class/function

    Good day!

    I want to know what is the syntax for date(dd-mm-yyyy) and how can I insert it to my code:
    PHP Code:
    $Mail->Subject 'Preview/' $this->csvUploadPaymentDetails[0]['csvfilename']; 
    Sorry, because I'm not familiar with class and function.

    i want toe result is Preview/Filename/Date/

    Thank you so much

  2. #2
    dooby dooby doo silver trophybronze trophy
    spikeZ's Avatar
    Join Date
    Aug 2004
    Location
    Manchester UK
    Posts
    13,805
    Mentioned
    157 Post(s)
    Tagged
    3 Thread(s)
    PHP Code:
    $Mail->Subject 'Preview/' $this->csvUploadPaymentDetails[0]['csvfilename'] .'/'.date('dd-mm-yyyy'); 
    Mike Swiffin - Community Team Advisor
    Only a woman can read between the lines of a one word answer.....

  3. #3
    Twitter: @AnthonySterling silver trophy AnthonySterling's Avatar
    Join Date
    Apr 2008
    Location
    North-East, UK.
    Posts
    6,111
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)
    Check out the manual page for date, it's pretty comprehensive.
    @AnthonySterling: I'm a PHP developer, a consultant for oopnorth.com and the organiser of @phpne, a PHP User Group covering the North-East of England.

  4. #4
    SitePoint Addict
    Join Date
    Jul 2010
    Posts
    247
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by spikeZ View Post
    PHP Code:
    $Mail->Subject 'Preview/' $this->csvUploadPaymentDetails[0]['csvfilename'] .'/'.date('dd-mm-yyyy'); 
    :)
    is it the same with this code

    PHP Code:
    $Mail->Subject 'Preview/' $this->csvUploadPaymentDetails[0]['csvfilename'] .'/'.date('d-m-Y'); 
    Thank you

  5. #5
    SitePoint Addict
    Join Date
    Jul 2010
    Posts
    247
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    How can I add this code:

    PHP Code:
    $this->csvUploadPaymentDetails[0]['week_num'
    with this code:

    PHP Code:
    $Mail->Subject 'Preview/' $this->csvUploadPaymentDetails[0]['csvfilename'] .'/'.date('d-m-Y'); 
    to make the subject become:

    Preview/Filename/Date/Week No

    Thank you

  6. #6
    SitePoint Addict
    Join Date
    Jul 2010
    Posts
    247
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by anil.singh View Post
    With this code:

    $Mail->Subject = 'Preview/' . $this->csvUploadPaymentDetails[0]['csvfilename'] .'/'.date('dd-mm-yyyy');
    is this the code for date is correct?not d'm'Y?ahm how about my code for week no how can I add that in my code:

    PHP Code:
    $Mail->Subject 'Preview/' $this->csvUploadPaymentDetails[0]['csvfilename'] .'/'.date('dd-mm-yyyy'
    Thank you

  7. #7
    dooby dooby doo silver trophybronze trophy
    spikeZ's Avatar
    Join Date
    Aug 2004
    Location
    Manchester UK
    Posts
    13,805
    Mentioned
    157 Post(s)
    Tagged
    3 Thread(s)
    see post #3 and follow the link Anthony gave you.
    Mike Swiffin - Community Team Advisor
    Only a woman can read between the lines of a one word answer.....


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
  •