/    Sign up×
Community /Pin to ProfileBookmark

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:

[code=php]
$Mail->Subject = ‘Preview/’ . $this->csvUploadPaymentDetails[0][‘csvfilename’];
[/code]

Sorry, because I’m not familiar with class and function.

i want toe result is Preview/Filename/Date/

Thank you so much

to post a comment
PHP

4 Comments(s)

Copy linkTweet thisAlerts:
@ralphchadkirkMay 17.2011 — So you want the current date in YYYY-MM-DD format?

If so, you need this function:
[code=php]
date("Y-m-d")
[/code]
Copy linkTweet thisAlerts:
@rhodaroseauthorMay 17.2011 — I want dd-mm-yyyy, I tried this code..Is it my date syntax is correct?and also how can I add this code:

[code=php]
$this->csvUploadPaymentDetails[0]['week_num']
[/code]


with this code:

[code=php]
$Mail->Subject = 'Preview/' . $this->csvUploadPaymentDetails[0]['csvfilename'] .'/'.date('d-m-Y');
[/code]


to make the subject become:

Preview/Filename/Date/Week No

Thank you
Copy linkTweet thisAlerts:
@jogolMay 17.2011 — [code=php]$Mail->Subject = 'Preview/' . $this->csvUploadPaymentDetails[0]['csvfilename'] . '/' . date('d-m-Y') . '/' . $this->csvUploadPaymentDetails[0]['week_num']; [/code]
Copy linkTweet thisAlerts:
@rhodaroseauthorMay 17.2011 — Thank you...
×

Success!

Help @rhodarose spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.8,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...