当前位置:首页 > 搜索和 代码 相关的文章

php字符匹配代码

添加日期:2014-08-17 21:06:19 发布:smiling 
字符串A:"1,3,4,5,6,7,8,9,10,11,12,14,15,17,20,22,123,457",例如我想知道这个字符串里面是否含有"2",这时候"12","20","22"等 一代码如下:if(in_array(& 39;2& 39;,explode(& 39;,& 39;,$str)) ...

php 正则得到url的地址代码

添加日期:2014-08-17 20:57:18 发布:smiling 
方法一代码如下$str=& 39;<ahref="http: www phpfensi com"target="_blank"name="doc3_p"><imgsrc=""onload="setImgSize(this,170,170);">< a>& 39;;preg_match_all(& 39;|^<ahref="( *)" *|U& ...

php简单自主开网页访问次数计数器代码

添加日期:2014-08-17 20:52:33 发布:smiling 
这里是我们用php简单自主开网页访问次数计数器代码偌,是一款基于文件的图形计数器范例代码,会用到的文件用:num txt 累计访问次数,vist php 测试文件,count php 统计访问次的核心程序,因为它会 ...

php 获取相对路径实例代码

添加日期:2014-08-17 20:49:42 发布:smiling 
functiongetRelativePath($a,$b){$returnPath=array(dirname($b));$arrA=explode(& 39; & 39;,$a);$arrB=explode(& 39; & 39;,$returnPath[0]);for($n=1,$len=count($arrB);$n<$len;$n++){if($arrA ...

php统计静态html页面浏览访问次数代码

添加日期:2014-08-17 20:47:51 发布:smiling 
count php,代码如下:$aid=isset($_GET[& 39;aid& 39;])?$_GET[& 39;aid& 39;]:& 39;& 39;;$t=isset($_GET[& 39;t& 39;])?$_GET[& 39;t& 39;]:& 39;& 39;;if(intval($aid)){if($t==& 39;show& 39;){ ...

php curl、fopen、file_get_contents实例代码

添加日期:2014-08-17 20:45:41 发布:smiling 
phpcurl实例代码如下:session_write_close();$pageurl="http: www phpfensi com index html";curl_setopt($ch,curlopt_returntransfer,1);curl_setopt($ch,curlopt_url,$pageurl);$html=curl_ex ...

php ereg_replace函数基础与实例代码

添加日期:2014-08-17 20:32:08 发布:smiling 
语法:string ereg_replace(string $pattern,string $replacement,string $string)修改后的字符串返回,如果没有找到匹配的字符串,那么将返回不变,实例代码如下:$string="thisphpfensi comatest" ...

获取url中部份内容代码

添加日期:2014-08-17 20:30:38 发布:smiling 
functiongetpath($url){$path=parse_url($url,php_url_path);$lastslash=strrpos($path," ");returnsubstr($path,1,$lastslash-1);}echoget ...

php模仿用户访问网页程序代码

添加日期:2014-08-17 20:29:34 发布:smiling 
functionhttpget($url,$followredirects=true){global$final_url;$url_parsed=parse_url($url);if(emptyempty($url_parsed[& 39;scheme& 39 ...

php计算页面执行了多长时间代码

添加日期:2014-08-17 20:19:28 发布:smiling 
functiontest(){list($a,$b)=explode("",microtime());return(float)$a+(float)$b;} 代码如下:$a=test();echo$a;$time=sprintf("% 12f",(double)test()-$a); 方法二,代码如下:functionss_timing_ ...

php几种采集远程服务器内容代码

添加日期:2014-08-17 18:19:16 发布:smiling 
方法一模仿用户访问网页functionreadpr($link,$url){$fp=fsockopen($url,80,$errno,$errstr,30);if(!$fp){echo"$errstr($errno)";exit(1);}else{$out="get$linkhttp 1 0";$out ="host:$url";$out ...

php把所有页面都指一个域名301永久转向代码

添加日期:2014-08-17 18:16:42 发布:smiling 
$sn=strtolower($_server[& 39;server_name& 39;]?$_server[& 39;server_name& 39;]:$_server[& 39;http_host& 39;]);$query=trim(@$_server[& 39;request_uri& 39;]);$sn=str_replace(& 39;http: ...