Home  >  Q&A  >  body text

Why is w in date("w") less than 6? ?

<?php

$week=date("w");

if($week<"6"){

echo "Not yet Weekend. Keep working...";

}else{

echo "What to do";

}

?>

如题?


益伦益伦2586 days ago1441

reply all(3)I'll reply

  • PHP中文网

    PHP中文网2017-10-13 12:57:19

    You print data('w') in sequence; and then modify the local computer time. Do a time test for a week. You will understand the purpose of this function after looking at the results. Try more and get hands-on

    reply
    0
  • 清风

    清风2017-10-13 10:50:04

    It’s equal to five. Continue to work...

    reply
    0
  • 寻觅 beyond

    寻觅 beyond2017-10-12 22:57:04

    w The day of the week, the number indicates 0 (meaning Sunday) to 6 (meaning Saturday)

    10-12 is Thursday, of course less than 6, feel free to go to work

    reply
    0
  • 益伦

    It turned out to be to get the time on the computer, thank you hahaha

    益伦 · 2017-10-13 13:23:44
  • Cancelreply