我们为大家详细介绍了有关PHP搜索引擎类的一些使用方法,希望对大家有些帮助。下面我们先以一个范例来讲解类文件的概念。#t#

PHP搜索引擎类1.类文件:
- class grabble{
- var $filename;
- var $html;
- var $urls = array(); //url历史
- var $url ;
- var $url_1;
- function grabble(){
- set_time_limit(3600);
- }
- function set($_filename){
- $this->filename = $_filename;
- array_push ($this->url, $_filename);
- }//end.set;
- function set_url($_url){
- eregi('(^http://.*[^/]).*' , $_url , $array);
- $this->url = $array[1] . "/";
- eregi('(^http://.*[^/]).*' , $_url , $array);
- //print_r($array);
- $this->url_1 = $array[1];
- }
- function get(){
- }//end.get;
- function get_html($_filename=null){
- $this->filename = $_filename;
- $this->html = @implode('', file($_filename)) ;
- return $this->html;
- }//end.get_html;
- function get_title($_str=null){
- preg_match_all("/</strong>(.*)<strong><</strong>\/title<strong>><br /> </strong>/Uis", $_str, $matches); </li><li>return $matches[1][0]; </li><li>}//end.get_title; </li><li>function get_img($_str=null){ </li><li>preg_match_all("/<strong><img</strong>\s+[^<strong>></strong>]*\s*src\s*=<br /> \s*([\'\"]?)([^\'\"<strong>></strong>\s]*)\\1\s*[^<strong>></strong>]*<strong>></strong>/i", <br /> $_str, $arr); </li><li>print_r($arr[2]); </li><li>} </li><li>function get_link($_str=null){ </li><li>preg_match_all("/<strong><a.</strong>*href=[\'|\"](.+)?<br /> [\'|\"].*<strong>></strong>.+<strong><</strong>\/a<strong>></strong>/Uis", $_str, $arr); </li><li>//print_r($arr); </li><li>return $arr[1]; </li><li>}//end.get_link; </li><li>function get_link_name($_str=null){ </li><li>preg_match_all("/<strong><a.</strong>*href=[\'|\"](.+)?<br /> [\'|\"].*<strong>></strong>(.+)<strong><</strong>\/a<strong>></strong>/Uis", $_str, $arr); </li><li>return $arr[2]; </li><li>}//end.get_link_name; </li><li>function link_list($_url=null, $_c=0){ </li><li>eregi('(^http://.*)/.*' , $_url , $array); </li><li>$_url_0 = $array[1]; </li><li>$_html = $this-<strong>></strong>get_html($_url); </li><li>$_link = $this-<strong>></strong>get_link($_html); </li><li>$_list = $this-<strong>></strong>get_link_name($_html); </li><li>$s = ""; </li><li>for($i=0;$i<strong><count</strong>($_link);$i++){ </li><li>$s .= "<br/>" . "<strong><INPUT</strong> TYPE='checkbox' <br /> NAME='link_name[]' value='" .$_link[$i]. "' <br /> <strong>/></strong>" . $_list[$i] . " "; </li><li>echo "<strong><br/></strong>" . "<strong><INPUT</strong> TYPE='checkbox' <br /> NAME='link_name[]' value='" .$_link[$i]. "' <br /> <strong>/></strong>" . $_list[$i] . " "; </li><li>echo "<strong><a</strong> href='" . $_url_0 . "/" . $_link[$i]<br /> . "' target='_blank'<strong>></strong>" . $_url_0 . "/" . <br /> $_link[$i] . "<strong></a></strong>"; </li><li>if($_c <strong><</strong> <strong>3</strong>){ </li><li>if(eregi('^[$_url_0|mailto:].*' ,$_link[$i])){ </li><li>echo "<strong><a</strong> href='" . $_link[$i] . "' <br /> target='_blank'<strong>></strong>" . $_link[$i] . "<strong></a></strong>"; </li><li>$s .= $this-<strong>></strong>link_list( $_link[$i] , $_c+1); </li><li>} </li><li>elseif(!eregi('^[http://|ftp://|file:///].<br /> *' ,$_link[$i])){ </li><li>$s .= $this-<strong>></strong>link_list( $_url_0 . "/" . $_link[$i] , $_c+1); </li><li>} </li><li>} </li><li>} </li><li>return $s; </li><li>}//end.link_list; </li><li>}//end.grabble. </li></ol><p><strong>PHP搜索引擎类2.调用实例:</strong></p><pre>
<ol>
<li>< ?php </li>
<li>require_once("grabble.<br>class.php"); </li>
<li>$gf = new grabble(); </li>
<li>echo $gf->link_list(<br>'http://10.22.65.101/'); </li>
<li>?> </li>
</ol><br></pre><p> 以上就是PHP搜索引擎类的相关使用方法。</p> <p>
分享文章:<a href="http://www.shufengxianlan.com/qtweb/news32/459932.html">实例讲解PHP搜索引擎类</a>
<br>
文章URL:<a href="http://www.shufengxianlan.com/qtweb/news32/459932.html">http://www.shufengxianlan.com/qtweb/news32/459932.html</a>
</p>
<p>
网站建设、网络推广公司-创新互联,是专注品牌与效果的网站制作,网络营销seo公司;服务项目有等
</p>
<p class="adpic">
<a href="https://www.cdcxhl.com/service/ad.html" target="_blank" class="ad">广告</a>
<a href="" target="_blank" class="adimg"><img src=""></a>
</p>
<p class="copy">
声明:本网站发布的内容(图片、视频和文字)以用户投稿、用户转载内容为主,如果涉及侵权请尽快告知,我们将会在第一时间删除。文章观点不代表本网站立场,如需处理请联系客服。电话:028-86922220;邮箱:631063699@qq.com。内容未经允许不得转载,或转载时需注明来源:
<a href="https://www.cdcxhl.com/" target="_blank">创新互联</a>
</p>
</div>
<div class="newsmorelb">
<p>猜你还喜欢下面的内容</p>
<ul>
<li>
<a href="/qtweb/news31/459931.html">windowscmd文件权限命令?(cmd设置文件权限)</a>
</li><li>
<a href="/qtweb/news30/459930.html">混合VS多云:Kafka架构中的五个主要比较</a>
</li><li>
<a href="/qtweb/news29/459929.html">微服务的灾难:折磨人的环境!</a>
</li><li>
<a href="/qtweb/news28/459928.html">百度联盟主题推广优质模板推荐</a>
</li><li>
<a href="/qtweb/news27/459927.html">Scala程序中如何实现多态和动态绑定</a>
</li><li>
<a href="/qtweb/news26/459926.html">阿里云正版图片</a>
</li><li>
<a href="/qtweb/news25/459925.html">python监控曲线_开始监控Python应用</a>
</li><li>
<a href="/qtweb/news24/459924.html">云端游戏服务器配置错误的解决方案</a>
</li><li>
<a href="/qtweb/news23/459923.html">使用香港服务器时要考虑哪几个方面事项</a>
</li> </ul>
</div>
</div>
<div class="col-lg-3 noneb">
<div class="bkright" style="margin-top: 0">
<p><a href="https://www.cdcxhl.com/news/yingxiao/">网站营销知识</a></p>
<ul>
<li>
<a class="text_overflow" href="/qtweb/news13/240663.html">MongoDB术语-数据中心感知</a>
</li><li>
<a class="text_overflow" href="/qtweb/news8/525958.html">从程序员到项目经理(十九):想改变任何人都是徒劳的</a>
</li><li>
<a class="text_overflow" href="/qtweb/news12/520812.html">微隔离入门指南</a>
</li><li>
<a class="text_overflow" href="/qtweb/news32/96532.html">虚线如何打html</a>
</li><li>
<a class="text_overflow" href="/qtweb/news42/276992.html">使用vps网页打不开怎么解决</a>
</li><li>
<a class="text_overflow" href="/qtweb/news28/54378.html">十大外汇服务器?(十大外汇服务器排名)</a>
</li><li>
<a class="text_overflow" href="/qtweb/news24/182574.html">html如何调用数据库</a>
</li><li>
<a class="text_overflow" href="/qtweb/news15/541615.html">西安到昆明机票西安到长水机场票价?</a>
</li><li>
<a class="text_overflow" href="/qtweb/news16/498116.html">创新互联Python教程:bash和python的区别有哪些</a>
</li><li>
<a class="text_overflow" href="/qtweb/news46/327996.html">全球邮箱是什么,全球邮箱的应用场景与优势</a>
</li><li>
<a class="text_overflow" href="/qtweb/news14/308564.html">windows2012搭建kms服务器?()</a>
</li><li>
<a class="text_overflow" href="/qtweb/news35/37185.html">Eclipse集成和调试Ant工程</a>
</li><li>
<a class="text_overflow" href="/qtweb/news46/140946.html">WOT2016彭哲夫:科班出身开发者对运维人员的期许</a>
</li><li>
<a class="text_overflow" href="/qtweb/news9/77759.html">远程控制如何不让对方知道。让他的服务器正常使用?服务器怎么屏蔽人</a>
</li><li>
<a class="text_overflow" href="/qtweb/news33/43983.html">如何在Linux下安装OpenSSL?(linux下安openssl)</a>
</li> </ul>
</div>
<div class="bkright tag">
<p><a href="https://www.cdcxhl.com/hangye/link.html" target="_blank">各行业网站</a></p>
<ul>
<li class="col-lg-6 col-md-6 col-sm-6 col-xs-6">
<a href="https://www.cdcxhl.com/hangye/jiudiansj/" target="_blank">酒店设计</a>
</li><li class="col-lg-6 col-md-6 col-sm-6 col-xs-6">
<a href="https://www.cdcxhl.com/hangye/fadianjihs/" target="_blank">发电机回收</a>
</li><li class="col-lg-6 col-md-6 col-sm-6 col-xs-6">
<a href="https://www.cdcxhl.com/hangye/hgdsj/" target="_blank">火锅店设计</a>
</li><li class="col-lg-6 col-md-6 col-sm-6 col-xs-6">
<a href="https://www.cdcxhl.com/hangye/hntjbz/" target="_blank">混凝土搅拌站</a>
</li><li class="col-lg-6 col-md-6 col-sm-6 col-xs-6">
<a href="https://www.cdcxhl.com/hangye/zaomaoji/" target="_blank">凿毛机</a>
</li><li class="col-lg-6 col-md-6 col-sm-6 col-xs-6">
<a href="https://www.cdcxhl.com/hangye/opp/" target="_blank">OPP胶袋</a>
</li><li class="col-lg-6 col-md-6 col-sm-6 col-xs-6">
<a href="https://www.cdcxhl.com/hangye/jiaquan/" target="_blank">除甲醛</a>
</li><li class="col-lg-6 col-md-6 col-sm-6 col-xs-6">
<a href="https://www.cdcxhl.com/hangye/boligeduan/" target="_blank">玻璃隔断</a>
</li><li class="col-lg-6 col-md-6 col-sm-6 col-xs-6">
<a href="https://www.cdcxhl.com/hangye/qzgqb/" target="_blank">轻质隔墙板</a>
</li><li class="col-lg-6 col-md-6 col-sm-6 col-xs-6">
<a href="https://www.cdcxhl.com/hangye/led/" target="_blank">LED显示屏</a>
</li><li class="col-lg-6 col-md-6 col-sm-6 col-xs-6">
<a href="https://www.cdcxhl.com/hangye/vr/" target="_blank">VR全景</a>
</li><li class="col-lg-6 col-md-6 col-sm-6 col-xs-6">
<a href="https://www.cdcxhl.com/hangye/sljbgc/" target="_blank">三轮搅拌车</a>
</li><li class="col-lg-6 col-md-6 col-sm-6 col-xs-6">
<a href="https://www.cdcxhl.com/hangye/zufadianji/" target="_blank">发电机租赁</a>
</li><li class="col-lg-6 col-md-6 col-sm-6 col-xs-6">
<a href="https://www.cdcxhl.com/hangye/shipaifang/" target="_blank">石牌坊</a>
</li><li class="col-lg-6 col-md-6 col-sm-6 col-xs-6">
<a href="https://www.cdcxhl.com/hangye/yangtaihulan/" target="_blank">阳台护栏</a>
</li><li class="col-lg-6 col-md-6 col-sm-6 col-xs-6">
<a href="https://www.cdcxhl.com/hangye/iso/" target="_blank">iso认证</a>
</li> </ul>
</div>
</div>
</div>
<div class="carousel-inner linkbg" style="background: #fff">
<div class="container">
<a href="http://www.ruijiemsc.com/" target="_blank">瑞杰管理</a> <a href="https://www.cdxwcx.com/city/suining/" target="_blank">遂宁网站建设</a> <a href="http://www.shganxi.cn/" target="_blank">簇桥薇薇新娘</a> <a href="http://www.cdxwcx.cn/bj/" target="_blank">网站制作价格</a> <a href="http://www.cdxwcx.cn/tuoguan/nanchong.html" target="_blank">南充服务器托管</a> <a href="https://www.cdxwcx.com/city/neijiang/" target="_blank">内江网站建设</a> <a href="https://www.cdcxhl.cn/
" target="_blank">香港云空间</a> <a href="https://www.xwcx.net/zuyong.html" target="_blank">主机租用</a> <a href="http://www.mbwzsj.com/" target="_blank">马边网站建设</a> <a href="https://www.xwcx.net/jigui.html" target="_blank">成都机房机柜租用</a> <a href="http://www.njwuji.cn/" target="_blank">亮美家</a> <a href="https://www.cdxwcx.com/jifang/wenjiang.html" target="_blank">温江服务器托管</a> <a href="http://m.cdcxhl.cn/applets/
" target="_blank">小程序开发公司</a> <a href="http://chengdu.cdcxhl.cn/
" target="_blank">成都网站建设</a> <a href="https://www.cdcxhl.com/gaiban/chengdu.html" target="_blank">成都网站改版</a> <a href="http://www.sczizhong.com/" target="_blank">资中网站建设</a> <a href="http://www.yzsxq.com/" target="_blank">成都水电改造</a> <a href="http://m.cdcxhl.cn/shop/" target="_blank">成都商城网站建设公司</a> <a href="https://www.cdcxhl.com/seo.html" target="_blank">seo优化排名</a> <a href="https://www.scvps.cn/" target="_blank">域名申请</a> </div>
</div>
<footer>
<div class="carousel-inner footjz">
<div class="container">
<i class="icon iconfont zbw"></i>
高品质定制 <i class="icon iconfont"></i>
跨终端自动兼容 <i class="icon iconfont"></i>
节约开发成本 <i class="icon iconfont"></i>
开发周期短 <i class="icon iconfont"></i>
一体化服务
<button type="button" class="btn btn-default btn-lg" onClick="window.location.href='tencent://message/?uin=631063699&Site=&Menu=yes'"> 立即开始2800定制网站建设</button>
<button type="button" class="btn btn-default btn-xs" onClick="window.location.href='tencent://message/?uin=631063699&Site=&Menu=yes'"> 2800定制网站建设</button>
</div>
</div>
<div class="carousel-inner bqsy">
<div class="container">
<div class="lxfs">
<h4 class="yutelnone">028-86922220 13518219792</h4>
<h4 class="yutelblock"><a href="tel:02886922220">028-86922220</a> <a href="tel:13518219792">13518219792</a></h4>
<a class="btn btn-default" href="tencent://message/?uin=532337155&Site=&Menu=yes" role="button">网站建设<span>QQ</span>:532337155</a>
<a class="btn btn-default" href="tencent://message/?uin=631063699&Site=&Menu=yes" role="button">营销推广<span>QQ</span>:631063699</a>
<a class="btn btn1 btn-default" href="mqqwpa://im/chat?chat_type=wpa&uin=532337155&version=1&src_type=web&web_src=oicqzone.com" role="button">网站制作<span>QQ</span>:532337155</a>
<a class="btn btn1 btn-default" href="mqqwpa://im/chat?chat_type=wpa&uin=631063699&version=1&src_type=web&web_src=oicqzone.com" role="button">营销推广<span>QQ</span>:631063699</a>
<a class="btn btn-default nonea" href="tencent://message/?uin=1683211881&Site=&Menu=yes" role="button">售后QQ:1683211881</a>
<div class="dz">创新互联建站专注:
<a href="https://www.cdcxhl.com/" target="_blank">网站设计</a>
<a href="https://www.cdcxhl.com/" target="_blank">网站制作</a>
<a href="https://www.cdcxhl.com/" target="_blank">网站建设</a>
<address>地址:成都太升南路288号锦天国际A幢10楼</address>
</div>
</div>
<div class="bzdh dz"><img src="https://www.cdcxhl.com/imges/bottom_logo.png" alt="创新互联">
<p><a href="https://www.cdcxhl.com/menu.html" target="_blank">成都创新互联科技有限公司</a><br>
Tel:400-028-6601(7x24h)</p></div>
</div>
</div>
</footer>
</body>
</html>
<script>
$.getJSON ("../../qtwebpic.txt", function (data) {
var jsonContent = {
"featured":data
}
var random = jsonContent.featured[Math.floor(Math.random() * jsonContent.featured.length)];
$(".adpic .adimg").attr("href",random.link)
$(".adpic img").attr("src",random.pic);
})
</script>