eveo
eveo

Reputation: 2843

How do you store a PHP date in a variable?

I'm trying to do this, but it's not working:

$date  = "on" date('l, F jS') "at" date('g:i:s A');

so that it will output:

on Day, Month 00th, at 0:00 PM  

(^ current date)

Upvotes: 0

Views: 774

Answers (1)

nickb
nickb

Reputation: 59709

Use the string concatenation operator:

$date  = "on " . date('l, F jS') . ", at " . date('g:i:s A');

Upvotes: 6

Related Questions