Home >Backend Development >PHP Problem >How to determine what day of the week it is today in php
php method to determine the day of the week today: first create a PHP sample file; then use the "date('w');" method to format the date; then define an array of "week"; finally pass "$ week[$w];" just output the judgment result.
Recommended: "PHP Video Tutorial"
php How to determine what day of the week it is today?
It’s very simple, as long as you are familiar enough with the php date function, it’s just one sentence!
See for yourself below!
<?php $w=date('w'); $week=array( "0"=>"星期日", "1"=>"星期一", "2"=>"星期二", "3"=>"星期三", "4"=>"星期四", "5"=>"星期五", "6"=>"星期六" ); echo '今天是'.$week[$w];
The above is the detailed content of How to determine what day of the week it is today in php. For more information, please follow other related articles on the PHP Chinese website!