php 获取目录下所有文件实现代码

 更新时间:2016年11月25日 16:25  点击:1973

php教程 获取目录下所有文件实现代码
class a{   
 private $img_dir;
        private $img_path;
        private $face_files = array();
        private $allow_extension = array();

private function get_face_files()
        {
            $files = array();
            if(is_dir($this->img_dir))
            {
                if ($dh = opendir($this->img_dir))
                {
                    while (($file = readdir($dh)) !== false)
                    {
                        if($file == '.') continue;
                        if($file == '..') continue;
                        $fileinfo = explode('.', (basename($file)));
                        if(in_array($fileinfo[1], $this->allow_extension))
                        {
                            $files[] = array(
                                'filename' => $fileinfo[0],
                                'extension' => $fileinfo[1],
                            );
                        }
                    }
                    closedir($dh);
                }
            }
            return $files;
        }
}

php教程读取flash文件高宽帧数背景颜色代码

<?php
/*
示例:
  $file = '/data/ad_files/5/5.swf';
  $flash = new flash();
  $flash = $flash->getswfinfo($file);
  echo "
文件的宽高是:".$flash["width"].":".$info["height"];
  echo "
文件版本是".$flash["version"];
  echo "
文件帧数量是".$flash["framecount"];
  echo "
文件帧速率是".$flash["framerate"];
  echo "
文件背景颜色是".$flash["bgcolor"];
*/
class flash
{
  //是否返回背景色
  public $need_back_color = false ;
 
  //是否返回版本
  public $need_version = false ;
 
  //是否返回帧速率
  public $need_framerate = false ;
 
  //是否返回帧数量
  public $need_framecount = false ;

  public function __construct()
  {

  }

  public function getswfinfo( $filename )
  {
    if ( file_exists($filename) ) {
       //echo "文件的修改时间:".date("m d y h:i:s.", filemtime($filename))."
";
    } else {
       //echo "目标文件不存在!";
       return array( "error" => $filename ) ;
    }

    //打开文件
    $rs = fopen($filename,"r");
   
    //读取文件的数据
    $str = fread( $rs , filesize( $filename ) ) ;
    ///
    if($str[0] == "f")
    {
       //echo "
文件已是解压缩的文件:";
    } else {
       $first = substr($str,0,8);
       $last = substr($str,8);
       //
       $last = gzuncompress($last);
       //
       $str = $first . $last ;
       $str[0] = "f";
       //echo "
解压缩后的文件信息:";
    }

    $info = $this->getinfo( $str );
    fclose ( $rs ) ;
    return $info;
  }

  private function mydecbin($str,$index)
  {
    $fbin = decbin(ord($str[$index]));
    while(strlen($fbin)<8)$fbin="0".$fbin;
    return $fbin;
  }

  private function colorhex($data)
  {
    $tmp = dechex($data);
    if ( strlen($tmp)<2 ) {
      $tmp='0' . $tmp ;
    }
    return $tmp;
  }

  private function getinfo( $str )
  {
    //换算成二进制
    $fbin = $this->mydecbin( $str , 8 ) ;
   
    //计算rec的单位长度
    $slen = bindec( substr( $fbin , 0 , 5 ) );
   
    //计算rec所在的字节
    $recsize = $slen * 4 + 5 ;
    $recsize = ceil( $recsize / 8 ) ;

    //rec的二进制
    $recbin = $fbin ;
    for( $i = 9 ; $i < $recsize + 8 ; $i++ )
    {
       $recbin .= $this->mydecbin( $str ,$i );
    }

    //rec数据
    $rec = array();
    for( $i = 0 ; $i < 4 ; $i++ )
    {
       $rec[] = bindec( substr( $recbin , 5 + $i * $slen , $slen ) ) / 20 ;
    }
   
    if ( $this->need_back_color ) {
      //背景颜色
      for( $i = $recsize + 12 ; $i < strlen ( $str ) ; $i ++ )
      {
         if ( ord( $str[$i] ) == 67 && ord( $str[$i+1] ) == 2 )
         {
          $bgcolor = $this->colorhex(ord($str[$i+2])).$this->colorhex(ord($str[$i+3])).$this->colorhex(ord($str[$i+4]));
          break;
         }
      }
    }
   
    if ( $this->need_version ) {
      //版本
      $version = ord( $str[3] );
    }
    if ( $this->need_framerate ) {
      //帧速率
      $framerate = ord( $str[$recsize + 8] ) / 256 + ord( $str[$recsize + 9] ) ;
    }

    if ( $this->need_framecount ) {   
      //帧数量
      $framecount = ord( $str[$recsize + 11] ) * 256 + ord( $str[$recsize + 10] );
    }
   
    return  array ( "bgcolor" => $bgcolor ,
            "version" => $version ,
            "framerate" => $framerate ,
            "framecount" => $framecount ,
            'width'=>$rec[1],
            'height'=>$rec[3]
            );
  }
}

?>

php教程自动获取关键字代码

$mincipin=5;//最小词频

$minlen=4;//关键字最小长度

tiqukeyword($tiqustr,$minlen,$mincipin);

function tiqukeyword($tiqustr,$minlen,$mincipin)

{$strlong=strlen($tiqustr);

$arr=array();

$k=-1;

for($i=0;$i<($strlong-$mincipin*$minlen);$i++){

$end=ceil(($strlong-$i)/$mincipin+$i);

for($j=$minlen;$j<$end;$j++){$num=0;

if(($guanjianzi=substr($tiqustr,$i,$j))!==false){

$wz=$i+$j;

$num++;}

else{break;}

while($wz<$strlong){if(($wz=strpos($tiqustr,$guanjianzi,$wz))!==false)

{$num++;

$wz=$wz+strlen($guanjianzi);}

else break;

}

if($j==$minlen){

if($num>=$mincipin){$maxnum=$num;$k++;$str=substr($tiqustr,$i,$j);

$arr[$k]=array($i,$j,$str,$num,0);

}

else{break;}
}

else{

if($num>=$maxnum){

$maxnum=$num;

$str=substr($tiqustr,$i,$j);

$arr[$k]=array($i,$j,$str,$num,0);

}

else break;

}
}

}

echo '初步得到的数组:';

print_r($arr);

//echo '<br/><br/><br/><br/>';

 

$arrlong=count($arr);

for($i=0;$i<$arrlong;$i++){

$bjarr=$arr[$i];

$nowid=$i;

if($bjarr[4]==1)continue;

for($j=$i+1;$j<$arrlong;$j++){

if($arr[$j][4]==1)continue;

$qujianks=$bjarr[0];

$qujianjs=$bjarr[1]+$bjarr[0]-1;

$a=$arr[$j][0];

$b=$arr[$j][1]+$arr[$j][0]-1;

if(($bjarr[2]==$arr[$j][2])&&($bjarr[3]>$arr[$j][3]))$arr[$j][4]=1;

 

if($a<=$qujianks&&$qujianks<=$b&&$a<=$qujianjs&&$qujianjs<=$b)

{if($bjarr[3]<=$arr[$j][3]){

$arr[$nowid][4]=1;$nowid=$j;$bjarr=$arr[$j];
}
}

elseif($qujianks<=$a&&$a<=$qujianjs&&$qujianks<=$b&&$b<=$qujianjs){

$arr[$j][4]=1;
}

}

}

 

echo '<br/><br/><br/><br/>重叠加标记后的数组:';

print_r($arr);

 

$jieguoarr=array();

for($i=0;$i<$arrlong;$i++)

{if($arr[$i][4]==0)$jieguoarr[]=$arr[$i];

 

}

echo '<br/><br/><br/><br/>';

echo '最后得到的数组:';

print_r($jieguoarr);

}

 

类名 :httprequest($url="",$method="get",$usesocket=0)
//$url为请求的地址;默认请求方法为get;$usesocket默认为0,使用fsockopen方法,如果设置为1则使用socket_create方法

方法:
open($ip="",$port=-1) //打开同服务器的连接,默认不用设置这两个参数(一个同事在linux用的时候,请求的不是hostname解析的ip,因此加了这两个参数,以连接真实的服务器ip)
settimeout($timeout=0) //设置获取数据的超时时间,必须在send方法调用之前设置才有效,单位秒,默认值0为不限制
setrequestheader($key,$value="") //设置请求头,必须在send方法调用之前设置才有效
removerequestheader($key,$value="") //移除指定键值的请求头,必须在send方法调用之前调用才有效
send($data="") //发送数据$data到服务器
getresponsebody() //获取服务器返回的文本
getallresponseheaders() //获取服务器响应的所有头信息
getresponseheader($key) //获取服务器响应的某个头信息,例如server,set_cookie等

属性:
$url //要请求的url
$method //请求方法(post/get)
$port //请求的端口
$hostname //请求的主机名
$uri //url的文件部分
$protocol //请求协议(http)(包括本属性的以上5个属性均由程序自动通过url分析)
$excption //异常信息
$_headers=array() //请求头array("key"=>"value")
$_senddata //发送到服务器的数据
$status //返回的状态码
$statustext //状态信息
$httpprotocolversion //服务器的http协议版本

注意:
host头由程序自动设置,当用post方法请求时,content-length和content-type已被自动设置。
支持gzip压缩的页面

inc.http.php教程文件

<?php

class httprequest{
 public $url,$method,$port,$hostname,$uri,$protocol,$excption,$_headers=array(),$_senddata,$status,$statustext,$httpprotocolversion;
 private $fp=0,$_buffer="",$responsebody,$responseheader,$timeout=0,$usesocket;
 //构造函数
 function __construct($url="",$method="get",$usesocket=0){
  $this->url = $url;
  $this->method = strtoupper($method);
  $this->usesocket = $usesocket;
  $this->setrequestheader("accept","*/*");
  $this->setrequestheader("accept-language","zh-cn");
  $this->setrequestheader("accept-encoding","gzip, deflate");
  $this->setrequestheader("user-agent","httprequest class 1.0");  //可调用setrequestheader来修改
 }
 
 //连接服务器
 public function open($ip="",$port=-1){
  if(!$this->_geturlinfo()) return false;
  $this->setrequestheader("host",$this->hostname);
  $this->setrequestheader("connection","close");
  $ip = ($ip=="" ? $this->hostname : $ip);
  $port = ($port==-1 ? $this->port : $port);
  if($this->usesocket==1){
   if(!$this->fp=$socket=socket_create(af_inet,sock_stream,0)) {
    $this->excption="can not create socket";return false;
   }else{
    if(!socket_connect($this->fp,$ip, $port) ){
     $this->excption="can not connect to server " . $this->hostname . " on port" . $this->port;return false;
    }
   }
  }else{
   if(!$this->fp=fsockopen($ip, $port,$errno,$errstr,10)) {
    $this->excption="can not connect to server " . $this->hostname . " on port" . $this->port;return false;
   }
  }
  return true;
 }
 
 public function send($data=""){
  if(!$this->fp){$this->excption="is not a resource id";return false;}
  if($this->method=="get" && $data!=""){
   $s_str="?";
   if(strpos($this->uri,"?")>0) $s_str = "&";
   $this->uri.= $s_str . $data;
   $data="";
  }
  $senddata=$this->method . " " . $this->uri . " http/1.1rn";
  if($this->method=="post"){
   $this->setrequestheader("content-length",strlen($data));
   $this->setrequestheader("content-type", "application/x-www-form-urlencoded");
  }
  foreach($this->_headers as $keys => $value){
   $senddata .= "$keys: $valuern";
  }
  $senddata .= "rn";
  if($this->method=="post") $senddata .= $data;
  $this->_senddata = $senddata;
  if($this->usesocket==1){
   socket_write($this->fp,$this->_senddata);
   $buffer="";
   $timestart = time();
   do{
    if($this->timeout>0){
     if(time()-$timestart>$this->timeout){break;}
    }
    $this->_buffer.=$buffer;
    $buffer = socket_read($this->fp,4096);
   }while($buffer!="");
   socket_close($this->fp); 
  }else{
   fputs($this->fp, $senddata);
   $this->_buffer="";
   $timestart = time();
   while(!feof($this->fp))
   {
    if($this->timeout>0){
     if(time()-$timestart>$this->timeout){break;}
    }
    $this->_buffer.=fgets($this->fp,4096);
   }
   fclose($this->fp);   
  }
  $this->_splitcontent();
  $this->_getheaderinfo();
 }
 
 public function getresponsebody(){
  if($this->getresponseheader("content-encoding")=="gzip" && $this->getresponseheader("transfer-encoding")=="chunked"){
   return gzdecode_1(transfer_encoding_chunked_decode($this->responsebody));
  }else if($this->getresponseheader("content-encoding")=="gzip"){
   return gzdecode_1($this->responsebody);
  }else{
   return $this->responsebody;
  }
 }
 
 public function getallresponseheaders(){
  return  $this->responseheader;
 }
 
 public function getresponseheader($key){
  $key = str_replace("-","-",$key);
  $headerstr = $this->responseheader . "rn";
  $count = preg_match_all("/n$key:(.+?)r/is",$headerstr,$result,preg_set_order);
  if($count>0){
   $returnstr="";
   foreach($result as $key1=>$value){
    if(strtoupper($key)=="set-cookie"){
     $value[1] = substr($value[1],0,strpos($value[1],";"));
    }
    $returnstr .= ltrim($value[1]) . "; ";
   }
   $returnstr = substr($returnstr,0,strlen($returnstr)-2);
   return $returnstr;
  }else{return "";}
 }
 
 public function settimeout($timeout=0){
  $this->timeout = $timeout; 
 }
 
 public function setrequestheader($key,$value=""){
  $this->_headers[$key]=$value;
 }
 
 public function removerequestheader($key){
  if(count($this->_headers)==0){return;}
  $_temp=array();
  foreach($this->_headers as $keys => $value){
   if($keys!=$key){
    $_temp[$keys]=$value;
   }
  }
  $this->_headers = $_temp;
 }
 
 //拆分url
 private function _geturlinfo(){
  $url = $this->url;
  $count = preg_match("/^http://([^:/]+?)(:(d+))?/(.+?)$/is",$url,$result);
  if($count>0){
   $this->uri="/" . $result[4];
  }else{
   $count = preg_match("/^http://([^:/]+?)(:(d+))?(/)?$/is",$url,$result);
   if($count>0){
    $this->uri="/";
   }
  }
  if($count>0){
   $this->protocol="http";
   $this->hostname=$result[1];
   if(isset($result[2]) && $result[2]!="") {$this->port=intval($result[3]);}else{$this->port=80;}
   return true;
  }else{$this->excption="url format error";return false;}
 }
 
 private function _splitcontent(){
  $this->responseheader="";
  $this->responsebody="";
  $p1 = strpos($this->_buffer,"rnrn");
  if($p1>0){
   $this->responseheader = substr($this->_buffer,0,$p1);
   if($p1+4<strlen($this->_buffer)){
    $this->responsebody = substr($this->_buffer,$p1+4);
   }
  }
 }
 
 private function _getheaderinfo(){
  $headerstr = $this->responseheader;
  $count = preg_match("/^http/(.+?)s(d+)s(.+?)rn/is",$headerstr,$result);
  if($count>0){
   $this->httpprotocolversion = $result[1];
   $this->status = intval($result[2]);
   $this->statustext = $result[3];
  }
 }
}


//以下两函数参考网络
function gzdecode_1 ($data) {
 $data = ($data);
 if (!function_exists ( 'gzdecode' )) {
  $flags = ord ( substr ( $data, 3, 1 ) );
  $headerlen = 10;
  $extralen = 0;
  $filenamelen = 0;
  if ($flags & 4) {
   $extralen = unpack ( 'v', substr ( $data, 10, 2 ) );
   $extralen = $extralen [1];
   $headerlen += 2 + $extralen;
  }
  if ($flags & 8) // filename
   $headerlen = strpos ( $data, chr ( 0 ), $headerlen ) + 1;
  if ($flags & 16) // comment
   $headerlen = strpos ( $data, chr ( 0 ), $headerlen ) + 1;
  if ($flags & 2) // crc at end of file
   $headerlen += 2;
  $unpacked = @gzinflate ( substr ( $data, $headerlen ) );
  if ($unpacked === false)
   $unpacked = $data;
  return $unpacked;
 }else{
  return gzdecode($data);
 }
}

function transfer_encoding_chunked_decode($in) {
 $out = "";
 while ( $in !="") {
  $lf_pos = strpos ( $in, "12" );
  if ($lf_pos === false) {
   $out .= $in;
   break;
  }
  $chunk_hex = trim ( substr ( $in, 0, $lf_pos ) );
  $sc_pos = strpos ( $chunk_hex, ';' );
  if ($sc_pos !== false)
   $chunk_hex = substr ( $chunk_hex, 0, $sc_pos );
  if ($chunk_hex =="") {
   $out .= substr ( $in, 0, $lf_pos );
   $in = substr ( $in, $lf_pos + 1 );
   continue;
  }
  $chunk_len = hexdec ( $chunk_hex );
  if ($chunk_len) {
   $out .= substr ( $in, $lf_pos + 1, $chunk_len );
   $in = substr ( $in, $lf_pos + 2 + $chunk_len );
  } else {
   $in = "";
  }
 }
 return $out;
}
function utf8togb($str){
 return iconv("utf-8","gbk",$str);
}

function gbtoutf8($str){
 return iconv("gbk","utf-8",$str);
}
?>

response.asp教程文件

<%
response.cookies("a") = "anlige"
response.cookies("a").expires = dateadd("yyyy",1,now())
response.cookies("b")("c") = "wsdasdadsa"
response.cookies("b")("d") = "ddd"
response.cookies("b").expires = dateadd("yyyy",1,now())
response.write "querystring : " & request.querystring & "<br />"
for each v in request.querystring
 response.write v & "=" & request.querystring(v) & "<br />"
next
response.write "<br />form : " &  request.form  & "<br />"
for each v in request.form
 response.write v & "=" & request.form(v) & "<br />"
next
response.write "<br />url : " &  request.servervariables("url")  & "<br />"
response.write "referer : " &  request.servervariables("http_referer")  & "<br />"
response.write "host : " &  request.servervariables("http_host")  & "<br />"
response.write "user-agent : " &  request.servervariables("http_user_agent")  & "<br />"
response.write "cookie" & request.servervariables("http_cookie")
%>

index.php文件

<a href="?action=get">get传数据</a>
<a href="?action=post">post传数据</a>
<a href="?action=header_referer">向服务器发送来路信息</a>
<a href="?action=header_useragent">向服务器发送user-agent</a>
<a href="?action=status">获取服务器返回的状态</a>
<a href="?action=get_headers">获取服务器响应头</a>
<a href="?action=get_image">保存图片</a><br /><br /><br />
<?php
include("inc_http.php");
$responseurl = "http://dev.mo.cn/aiencode/http/response.asp";

$act = isset($_get["action"]) ? $_get["action"] : "";
if($act == "get"){  //get传数据

 $myhttp = new httprequest("$responseurl?a=text");
 $myhttp->open();
 $myhttp->send("name=anlige&city=" . urlencode("杭州"));
 echo($myhttp->getresponsebody()); 
 
}else if($act == "post"){ //post传数据

 $myhttp = new httprequest("$responseurl?a=text","post");
 $myhttp->open();
 $myhttp->send("name=anlige&city=" . urlencode("杭州"));
 echo($myhttp->getresponsebody());
 
}else if($act == "header_referer"){  //向服务器发送来路信息

 $myhttp = new httprequest("$responseurl?a=text","post");
 $myhttp->open();
 $myhttp->setrequestheader("referer","http://www.baidu.com");
 $myhttp->send("name=anlige&city=" . urlencode("杭州"));
 echo($myhttp->getresponsebody()); 
 
}else if($act == "header_useragent"){  //向服务器发送user-agent

 $myhttp = new httprequest("$responseurl?a=text","post");
 $myhttp->open();
 $myhttp->setrequestheader("referer","http://www.baidu.com");
 $myhttp->setrequestheader("user-agent","mozilla/4.0 (compatible; msie 7.0; windows nt 6.0; trident/4.0)");
 $myhttp->send("name=anlige&city=" . urlencode("杭州"));
 echo($myhttp->getresponsebody()); 
 
}else if($act == "status"){   //获取服务器返回的状态

 $myhttp = new httprequest("$responseurl?a=text","post");
 $myhttp->open();
 $myhttp->send("name=anlige&city=" . urlencode("杭州"));
 echo($myhttp->status . " " . $myhttp->statustext ."<br /><br />"); 
 echo($myhttp->getresponsebody());
 
}else if($act == "get_headers"){  //获取服务器响应头

 $myhttp = new httprequest("$responseurl?a=text","get");
 $myhttp->open();
 $myhttp->send("name=anlige&city=" . urlencode("杭州"));
 echo($myhttp->getallresponseheaders()."<br /><br />");  
 echo($myhttp->getresponseheader("server")."<br /><br />"); 
 
}else if($act == "get_image"){
 
 $myhttp = new httprequest("http://www.baidu.com/img/baidu_logo.gif");
 $myhttp->open();
 $myhttp->send(); 
 $fp = @fopen("demo.gif","w");
 fwrite($fp,$myhttp->getresponsebody());
 fclose($fp);
 echo("<img src="demo.gif" />");
}

?>

php教程文件缓存实例代码
缓存在实际使用当中应用很广泛,可以减轻对服务器数据库教程的访问,提高运行速度。目前很多cms内容管理系统中频繁使用缓存机制来提高系统运行的效率
cache.php 代码如下:
php代码
<? 
/*
用户需要事先定义的常量:
_cachepath_        模板缓存路径
_cacheenable_        自动缓存机制是否开启,未定义或为空,表示关闭自动缓存机制
_recachetime_        自动重新缓存间隔时间,单位为秒,未定义或为空,表示关闭自动重新缓存
*/ 
 
class cache { 
 
var $cachefile; 
var $cachefilevar; 
 
function cache() { 
        //生成当前页的cache组文件名 $this->cachefilevar 及文件名 $this->cachefile 
        //动态页的参数不同对应的cache文件也不同,但是每一个动态页的所有cache文件都有相同的文件名,只是扩展名不同 
        $s=array(".","/");$r=array("_",""); 
        $this->cachefilevar=str_replace($s,$r,$_server["script_name"])."_".$_get[_actionvar_]; 
        $this->cachefile=$this->cachefilevar.".".md5($_server["request_uri"]); 

 
//删除当前页/模块的缓存 
function delete() { 
        //删除当前页的缓存 
        $d = dir(_cachepath_); 
        $strlen=strlen($this->cachefilevar); 
        //返回当前页的所有cache文件组 
        while (false !== ($entry = $d->read())) { 
                    if (substr($entry,0,$strlen)==$this->cachefilevar) { 
                            if (!unlink(_cachepath_."/".$entry)) {echo "cache目录无法写入";exit;} 
                    } 
            } 

 
//判断是否已cache过,以及是否需要cache 
function check() { 
        //如果设置了缓存更新间隔时间 _recachetime_ 
        if (_recachetime_+0>0)        { 
                //返回当前页cache的最后更新时间 
                $var=@file(_cachepath_."/".$this->cachefilevar);$var=$var[0]; 
                //如果更新时间超出更新间隔时间则删除cache文件 
                if (time()-$var>_recachetime_) { 
                        $this->delete();$ischage=true; 
                } 
        } 
        //返回当前页的cache 
        $file=_cachepath_."/".$this->cachefile; 
        //判断当前页cache是否存在 且 cache功能是否开启 
        return (file_exists($file) and _cacheenable_ and !$ischange); 

 
//读取cache 
function read() { 
        //返回当前页的cache 
        $file=_cachepath_."/".$this->cachefile; 
        //读取cache文件的内容 
        if (_cacheenable_) return readfile($file); 
        else return false; 

 
//生成cache 
function write($output) { 
        //返回当前页的cache 
        $file=_cachepath_."/".$this->cachefile; 
        //如果cache功能开启 
        if (_cacheenable_) { 
                //把输出的内容写入cache文件 
                fopen($file,'w'">$fp=@fopen($file,'w'); 
                if (!@fputs($fp,$output)) {echo "模板cache写入失败";exit;} 
                @fclose($fp); 
                //如果设置了缓存更新间隔时间 _recachetime_ 
                if (_recachetime_+0>0) { 
                        //更新当前页cache的最后更新时间 
                        $file=_cachepath_."/".$this->cachefilevar; 
                        $fp=@fopen($file,'w'); 
                        if (!@fwrite($fp,time())) {echo "cache目录无法写入";exit;} 
                        @fclose($fp); 
                } 
        } 

 

?> 
使用过程:
php代码
<?php 
        define("_cachepath_","./cache/"); 
        define("_cacheenable_","1"); 
        define("_recachetime_","43200"); 
        include('cache.php'); 
        $cache=new cache(); 
        if ($cache->check()) { 
        $template=$cache->read(); 
                }else { 
                ob_start(); 
                ob_implicit_flush(0); 
        ?> 
                                  页面内容。。。。 
<?php 
        $template = ob_get_contents(); 
        $cache->write($template); 
        } 
        ?> 

[!--infotagslink--]

相关文章

  • php读取zip文件(删除文件,提取文件,增加文件)实例

    下面小编来给大家演示几个php操作zip文件的实例,我们可以读取zip包中指定文件与删除zip包中指定文件,下面来给大这介绍一下。 从zip压缩文件中提取文件 代...2016-11-25
  • PHP成员变量获取对比(类成员变量)

    下面本文章来给大家介绍在php中成员变量的一些对比了,文章举了四个例子在这例子中分别对不同成员变量进行测试与获取操作,下面一起来看看。 有如下4个代码示例,你认...2016-11-25
  • Jupyter Notebook读取csv文件出现的问题及解决

    这篇文章主要介绍了JupyterNotebook读取csv文件出现的问题及解决,具有很好的参考价值,希望对大家有所帮助。如有错误或未考虑完全的地方,望不吝赐教...2023-01-06
  • php 获取用户IP与IE信息程序

    php 获取用户IP与IE信息程序 function onlineip() { global $_SERVER; if(getenv('HTTP_CLIENT_IP')) { $onlineip = getenv('HTTP_CLIENT_IP');...2016-11-25
  • php获取一个文件夹的mtime的程序

    php获取一个文件夹的mtime的程序了,这个就是时间问题了,对于这个问题我们来看小编整理的几个例子,具体的操作例子如下所示。 php很容易获取到一个文件夹的mtime,可以...2016-11-25
  • 如何获取网站icon有哪些可行的方法

    获取网站icon,常用最简单的方法就是通过website/favicon.ico来获取,不过由于很多网站都是在页面里面设置favicon,所以此方法很多情况都不可用。 更好的办法是通过google提供的服务来实现:http://www.google.com/s2/favi...2014-06-07
  • Photoshop打开PSD文件空白怎么解决

    有时我们接受或下载到的PSD文件打开是空白的,那么我们要如何来解决这个 问题了,下面一聚教程小伙伴就为各位介绍Photoshop打开PSD文件空白解决办法。 1、如我们打开...2016-09-14
  • C#操作本地文件及保存文件到数据库的基本方法总结

    C#使用System.IO中的文件操作方法在Windows系统中处理本地文件相当顺手,这里我们还总结了在Oracle中保存文件的方法,嗯,接下来就来看看整理的C#操作本地文件及保存文件到数据库的基本方法总结...2020-06-25
  • 解决python 使用openpyxl读写大文件的坑

    这篇文章主要介绍了解决python 使用openpyxl读写大文件的坑,具有很好的参考价值,希望对大家有所帮助。一起跟随小编过来看看吧...2021-03-13
  • C#实现HTTP下载文件的方法

    这篇文章主要介绍了C#实现HTTP下载文件的方法,包括了HTTP通信的创建、本地文件的写入等,非常具有实用价值,需要的朋友可以参考下...2020-06-25
  • SpringBoot实现excel文件生成和下载

    这篇文章主要为大家详细介绍了SpringBoot实现excel文件生成和下载,文中示例代码介绍的非常详细,具有一定的参考价值,感兴趣的小伙伴们可以参考一下...2021-02-09
  • php无刷新利用iframe实现页面无刷新上传文件(1/2)

    利用form表单的target属性和iframe 一、上传文件的一个php教程方法。 该方法接受一个$file参数,该参数为从客户端获取的$_files变量,返回重新命名后的文件名,如果上传失...2016-11-25
  • jquery如何获取元素的滚动条高度等实现代码

    主要功能:获取浏览器显示区域(可视区域)的高度 : $(window).height(); 获取浏览器显示区域(可视区域)的宽度 :$(window).width(); 获取页面的文档高度 $(document).height(); 获取页面的文档宽度 :$(document).width();...2015-10-21
  • php批量替换内容或指定目录下所有文件内容

    要替换字符串中的内容我们只要利用php相关函数,如strstr,str_replace,正则表达式了,那么我们要替换目录所有文件的内容就需要先遍历目录再打开文件再利用上面讲的函数替...2016-11-25
  • PHP文件上传一些小收获

    又码了一个周末的代码,这次在做一些关于文件上传的东西。(PHP UPLOAD)小有收获项目是一个BT种子列表,用户有权限上传自己的种子,然后配合BT TRACK服务器把种子的信息写出来...2016-11-25
  • jquery获取div距离窗口和父级dv的距离示例

    jquery中jquery.offset().top / left用于获取div距离窗口的距离,jquery.position().top / left 用于获取距离父级div的距离(必须是绝对定位的div)。 (1)先介绍jquery.offset().top / left css: 复制代码 代码如下: *{ mar...2013-10-13
  • Jquery 获取指定标签的对象及属性的设置与移除

    1、先讲讲JQuery的概念,JQuery首先是由一个 America 的叫什么 John Resig的人创建的,后来又很多的JS高手也加入了这个团队。其实 JQuery是一个JavaScript的类库,这个类库集合了很多功能方法,利用类库你可以用简单的一些代...2014-05-31
  • AI源文件转photoshop图像变模糊问题解决教程

    今天小编在这里就来给photoshop的这一款软件的使用者们来说下AI源文件转photoshop图像变模糊问题的解决教程,各位想知道具体解决方法的使用者们,那么下面就快来跟着小编...2016-09-14
  • C++万能库头文件在vs中的安装步骤(图文)

    这篇文章主要介绍了C++万能库头文件在vs中的安装步骤(图文),文中通过示例代码介绍的非常详细,对大家的学习或者工作具有一定的参考学习价值,需要的朋友们下面随着小编来一起学习学习吧...2021-02-23
  • Zend studio文件注释模板设置方法

    步骤:Window -> PHP -> Editor -> Templates,这里可以设置(增、删、改、导入等)管理你的模板。新建文件注释、函数注释、代码块等模板的实例新建模板,分别输入Name、Description、Patterna)文件注释Name: 3cfileDescriptio...2013-10-04