In PHP, you only need to set a parameter in the date() function, and the parameter value is "d" to get the current time. The date() function can format the current local time or the specified timestamp (when setting the second parameter). When the required parameter is set to "d", the day of the month can be calculated for the specified time.
The operating environment of this tutorial: windows7 system, PHP7.1 version, DELL G3 computer
php uses date( ) Get the current number
<?php header("Content-type:text/html;charset=utf-8"); echo '当前是:'.date("d")."号"; ?>
Output:
# #Description:
date() function formats the local date and time and returns the formatted date string. Syntax:date(format,timestamp);
PHP Video Tutorial"
The above is the detailed content of How to use date() in php to get the current date. For more information, please follow other related articles on the PHP Chinese website!