$DateY=Date(Y); $DateM=Date(m); $DateD=Date(d); // $NDATE=$SolarYear .$SolarMonth .$SolarDate; for ($i=0; $i<=20; $i++) if (file_exists($DateY .$DateM .$DateD)) { $NDATE=$DateY .$DateM .$DateD; } else { $NDATE=date(Ymd,mktime(0,0,0,$DateM ,$DateD-$i,$DateY)); if (file_exists($NDATE)) { $i=100; } } next ?>