Home > Article > Backend Development > How to calculate the day of the week in php
php method to calculate what day of the week the current date is: first open the php editor and create a new php file; then enter the code [$day = '2020-08-26';$week = date('l', $day)]; Finally, the browser can run the [index.php] page.
【Related learning recommendations: php graphic tutorial】
php method to calculate the day of the week the current date is:
1. First, open the php editor and create a new php file, for example: index.php.
2. In index.php, enter the code:
$day = '2020-08-26';$week = date('l', $day);echo $week;
3. Run index.php in the browser page, and the day of the week for the specified date will be printed.
If you want to know more about related learning, please pay attention to the php training column!
The above is the detailed content of How to calculate the day of the week in php. For more information, please follow other related articles on the PHP Chinese website!