Output CSS class based on day-of-the-week match
I would suggest you familiarize yourself with the DateTime class and it's related classes including DateInterval and DatePeriod as these are your most powerful tools for working with date/times, intervals of time, and iterating over intervals of time.

You should have no reason to build an array for days for the week or anything like that.

Let me give an example for how you might approach this problem using these classes.

// current DateTime
$now = new DateTime();
// create a DateTime representing the beginning of the week
$monday = clone $now;
$monday-&gt;setTime(0,0,0)
       -&gt;modify('Monday this week');
// create a DateInterval to represent a one day interval
$dayInterval = new DateInterval('P1D');
// create a DatePeriod to represent a full week
$weekPeriod = new DatePeriod($monday, $dayInterval, 7);
// iterate the DatePeriod
foreach($weekPeriod as $day) {
    if($day-&gt;format('D') === $now-&gt;format('D')) {
        // today matches this day of week
    }
}


Beyond that, I would suggest being cognizant of your styling.  Right now:
- your indentations are inconsistent
- your variable naming style in inconsistent between using snake_case, camelCase (like in $dataarray keys), and no way to differentiate words in your variable name at all (i.e.$dayofweek, $dataarray).  You should pick either snake_case or camelCase to make your code more readable and stick with whichever style you choose.  I would actually recommend camelCase as PHP, as a language, is moving more in that direction with regard to industry styling standards.