检查日期('l')是否在数组中

I want to check if a date value is in an array. This is what I did:

$day = array('Monday','Tuesday','Wednesday');
if(date('l') === $day){
   //Do your thing
}

I guess I'm missing something or not fully understand why this doesn't work.
The idea is to make this statement false if the date is past Thuesday until Sunday. This was the only way I could think of because this is allready in a loop.

you could try this to find a variable is array or not

$day = array('Monday','Tuesday','Wednesday');

echo is_array($day) ? 'Array' : 'not an Array';

You should use in_array function, like this:

if( in_array( date('l'), $day ) ) { 
     // the day from date('l') is in array!
}

in_array does exactly what you want:

<?php
$day = array('Monday','Tuesday','Wednesday');
if(in_array(date('l'), $day)){
  //Do your thing
}
?>

date('N') will return a numerical representation of th day of the week, being 4 a thursday. So you want do stuff if date('N') is less than 4. Hence:

if (date('N') < 4) {
   do_your_thing
}