header("Content-type: text/html; charset=EUC-JP"); $newday=mktime(date("H"),date("i"),date("s"),(date("m")-1),date("d"),date("Y")); //ファイルが存在すればループ $fl=fopen("admin/save_news.txt","r"); while(!feof($fl)){ $cnt++; $cnt_name="a".$cnt; $id2=fgets($fl,16384); $ndate2=fgets($fl,16384); $koukai2=fgets($fl,16384); $title2=fgets($fl,16384); $body2=fgets($fl,16384); if($sday2!="\n" and $koukai2!="非公開\n"){ $jun[$cnt_name]=ereg_replace("\n","",$ndate2); $id[$cnt_name]=ereg_replace("\n","",$id2); $ndate[$cnt_name]=ereg_replace("\n","",$ndate2); $koukai[$cnt_name]=ereg_replace("\n","",$koukai2); $title[$cnt_name]=ereg_replace("\n","",$title2); $body[$cnt_name]=ereg_replace("\n","",$body2); } } arsort($jun,SORT_NUMERIC); $junban=array_keys($jun); $ken=sizeof($id)-1; if($ken>2){ $ken=2; } ?>
echo date("Y/m/d",$ndate[$junban[$i]])."[".date("D",$ndate[$junban[$i]]); ?>] |
echo $title[$junban[$i]]; ?> if($ndate[$junban[$i]]>$newday){ echo "[ NEW ]"; } ?> |
本文のおわりです