I am currently building some code that changes the background color of a number inside the array I have specified.
I can get the code to successfully change the background color of a specified number, when I am trying to apply the same code to an array of numbers it is changing the background color but it's then echoing the unformatted numbers afterwards.
<?php
$month_end = '31';
$start = '10';
$end = '15';
foreach (range($start, $end) as $trip_array) {
foreach (range(1, $month_end) as $number) { ?>
<?php
if($number === $trip_array) {
?>
<td style="background-color: #ccc;"><?php echo $number; ?></td>
<?php
} else { ?>
<td><?php echo $number; ?></td>
<?php
}
}
}
?>
I can't yet post an image so I hope I have supplied enough information with my problem and would really appreciate a fresh set of eyes on this :)
Thank you.