I want to know if there is a way to proceed through all three cases,if they are all true,but with using break,because as an example,if the first case is true,the second case is false and the third is also false,and i am not using break,it will procced trough all anyway.Change the strtotime with 6 October 2014,and you will see what i mean
$date = strtotime("1 October 2014");
switch($date) {
case (date('l', $date) == 'Monday'): //case 1: If the current day is Monday
echo "weekly<br>";
break;
case (date('d', $date) == '01'): //case 2: If the current day of the month is 1
echo "monthly<br>";
break;
case ( ((date('n') % 3) == '1') && (date('d') == '01') ): //case 3: If a quart of the year has just passed,and we are in the first day of a new quart
echo 'quarterly<br>';
break;
}
Any suggestion??? And if it is not possible with switch,how should i make it with if,to execute the code line 3 times,one for each case.