Switch statement

How would I say in this switch statement Pisces displays at X number of days in January and Aries at some other day in the same month? Dahnus is default for January and should disappear when replaced by the others on the specified days below…

There will be 24 months in this switch all having replacement switch definitions.

<?php
// date command to find out the day of the week
$date = date('F');
// our switch statement will assess which day of the week it is and
// assign our $content as assigned.
switch ($date) {
  case 'Jan':
    $content = "Dahnus";
//$content = " Pisces";
//$content = " Aries";
    break;
  case 'Feb':
    $content = "Aquarius";
//$content = " Virgo";
//$content = " Kanya";

    break;
  
}

// display our content regardless of day 
echo $content;
?>

I don’t know exactly what you are trying to do (maybe others do). Care to explain a little further. Though from what you have written, it sounds like there should be a better way that using all those switch definitions and less code would also mean easier to modify, delete or add? Maybe an array?

Sponsor our Newsletter | Privacy Policy | Terms of Service