php.net新闻拦截

高洛峰
发布: 2016-12-02 11:46:26
原创
1124人浏览过

zuojiankuohaophpcn? 
//请自己修改下面变量. 
$newsnum=7; 
$space=20; 
$width=400; 
$headclass="class5"; 
$lowerclass="class6"; 
//变量设置结束. 

print "<html><head><link rel=stylesheet href="http://www.php.cn/"> 
$opened=$query_string; 
if ($opened=="") { $opened="-1"; } 

print "<table><tr><td class=class5><a target=_blank href="http://www.php.cn/"> 
$file=file('http://www.php.net'); 

$where=""; 
$a=0; 
while ($a<count($file)) { 
$file[$a]=chop ($file[$a]); 
if ($file[$a]=="<!--http://www.php.net/-->") { 
$where=$a; 
break 1; 

$a++; 


$file=file('http://www.php.net'); 
$a=$where+1; 
$b=0; 
while ($b<$newsnum) { 
if (substr($file[$a],0,4)=="<h3>" & substr($file[$a],-6,5)=="</h3>" | substr($file[$a],0,4)=="<h3>" & substr($file[$a],-7,5)=="</h3>") { 
$from=$to; 
$to=$a; 


if ($to==$a & $from!="") { 
$c=$from; 
if ($b==$opened) { 
while ($c<$to) { 
if (substr($file[$c],0,9)=="<img src=") { 
$file[$c]=""; 

$file[$c]=eregi_replace("src="","src="http://www.php.net/",$file[$c]); 
$file[$c]=eregi_replace("href="http://www.php.cn/"> $file[$c]=eregi_replace("<h3>","</td></tr><tr><td width=$width class=$headclass><a href="http://www.php.cn/"> $file[$c]=eregi_replace("</h3>","</a></td></tr><tr><td width=$width class=$lowerclass>",$file[$c]); 
print $file[$c]; 
$c++; 

} else { 
if (substr($file[$c],0,9)=="<img src=") { 
$file[$c]=""; 

$file[$c]=eregi_replace("src="","src="http://www.php.net/",$file[$c]); 
$file[$c]=eregi_replace("href="http://www.php.cn/"> $file[$c]=eregi_replace("<h3>","</td></tr><tr><td width=$width class=$headclass><a href="http://www.php.cn/"> $file[$c]=eregi_replace("</h3>","</a></td></tr><tr><td width=$width class=$lowerclass>",$file[$c]); 
print $file[$c]; 

$b++; 

$a++; 

print "</table>"; 
print "</body></head>"; 
?> 

相关标签:
php
PHP速学教程(入门到精通)
PHP速学教程(入门到精通)

PHP怎么学习?PHP怎么入门?PHP在哪学?PHP怎么学才快?不用担心,这里为大家提供了PHP速学教程(入门到精通),有需要的小伙伴保存下载就能学习啦!

下载
来源:php中文网
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn
最新问题
开源免费商场系统广告
热门教程
更多>
最新下载
更多>
网站特效
网站源码
网站素材
前端模板
关于我们 免责申明 意见反馈 讲师合作 广告合作 最新更新 English
php中文网:公益在线php培训,帮助PHP学习者快速成长!
关注服务号 技术交流群
PHP中文网订阅号
每天精选资源文章推送
PHP中文网APP
随时随地碎片化学习

Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号