$curdate= date('N');
switch ($curdate)
{
case 1:
$diff='0,1,2,3,4,5,6';
break;
case 2:
$diff='-1,0,1,2,3,4,5';
break;
case 3:
$diff='-2,-1,0,1,2,3,4';
break;
case 4:
$diff='-3,-2,-1,0,1,2,3';
break;
case 5:
$diff='-4,-3,-2,-1,0,1,2';
break;
case 6:
$diff='-5,-4,-3,-2,-1,0,1';
break;
case 7:
$diff='-6,-5,-4,-3,-2,-1,0';
break;
}
//echo $diff;
$arrdiff=split(',',$diff);
$time=time();
$tripStart=date('Y-m-d',$time+ (($arrdiff[0]-1) * 3600 * 24));
$tripEnd=date('Y-m-d',$time+ (($arrdiff[6]+1) * 3600 * 24));
foreach ($arrdiff as $k){
$arrday[]=date('d',$time + ($k * 3600 * 24));
$arrweek[date('Y-m-d',($time + ($k * 3600 * 24)))]='';
}