How can I show a date from today with PHP?

I am sending a mail function to myself.

My first line reads "Order for $ name on $ date" The $ name variable comes from the form the user fills out. I would like the $ date variable to be today date, no matter what that day was.

How to make the current $ date variable the current date?

0


a source to share


3 answers


$date = date('m/d/Y');

      



see http://en.php.net/manual/en/function.date.php for date () syntax

+1


a source


http://us3.php.net/manual/en/function.date.php The date () function does this.



+1


a source


This puts date on a string today , all ready to get stuck in the DB :).

$todays_date_string = date("Y-m-d H:i:s"); 

      

0


a source







All Articles