Needs to achieve such an effect:
$dateall=$year.$month.$day;
$arr_from=array('20120401','20120416','20120510');
$arr_to=array('20120405','20120425','20120515');
if($dateall>=$arr_from[0] && $dateall<=$arr_to[0] || $dateall>=$arr_from[1] && $dateall<=$arr_to[1] || ...)
{
$calendar .= '<td class="reservation"><span title="reservation" id="id'.$year.$month.$day.'">'.$day.'</span></td>';
}
else if
//other conditions
The above code works fine.
But I need to rewrite this code as:
if($dateall>=$arr_from[$j] && $dateall<=$arr_to[$j]) // something like a loop
{
$calendar .= '<td class="reservation"><span title="reservation" id="id'.$year.$month.$day.'">'.$day.'</span></td>';
...
Does anyone know how to do it?