1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66
| <?php <!--先输出每列标题--> <!--再打开txt--> <!--读取出数据后,使用函数进行分割。--> <!--将分割完的存入数组--> <!--再将数组中的数据,按照格式每行输出。--> <!--列标题: 热度 标题 作者 发表时间 操作-->
<!DOCTYPE html> <html> <head> <meta charset="utf-8" /> <title><?php echo 'ICQ新闻震撼部';?></title> </head> <body background="tupian/bg.jpg"> <center><?php echo "ICQ新闻震撼部";?></center> ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
<table> <tr> <th><button><?php echo "热度✍"; ?></button></th> <th><?php echo "标题"; ?></th> <th><?php echo "作者"; ?></th> <th><?php echo "发表时间"; ?></th> <th><?php echo "操作"; ?></th> </tr> <?php $f = fopen("news.db","r"); $i=0; while(!feof($f)){ $hang = fgets($f); $shuzu = explode("|",$hang);
$redu = base64_decode($shuzu[0]); $biaoti = base64_decode($shuzu[1]); $zuozhe = base64_decode($shuzu[2]); $fashijian = base64_decode($shuzu[3]); $caozuo = base64_decode($shuzu[4]); $tupian = base64_decode($shuzu[5]); $jianjie = substr(base64_decode($shuzu[6]),"0","400"); echo <<<EOF <tr> <td align="center">$redu</td> <td align="center">$biaoti</td> <td align="center">$zuozhe</td> <td align="center">$fashijian</td> <td align="center">$caozuo</td> </tr> EOF; if($i<3){ echo <<<EOF <tr> <td>$tupian</td> <td colspan="4">$jianjie</tr> EOF; $i++; } } ?>
</table> ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- <center>版权所有 ICQ</center> <center>©2019 ICQ 意见反馈 京ICP证030173号 京公网安备11000002000001号 </center> </body> </html>
|