php上传Excel文件时如何判断文件中有图片

 更新时间:2016年11月25日 16:22  点击:1810
php上传Excel文件时如何判断文件中有图片 有需要的朋友可参考参考。
 代码如下 复制代码
$excelPath = 'Test.xls';
 
 $objReader = PHPExcel_IOFactory::createReader('Excel5');
 $objReader->setReadDataOnly(true);
 
 $objPHPExcel = $objReader->load($excelPath);
 $currentSheet = $objPHPExcel->getActiveSheet();
 $AllImages= $currentSheet->getDrawingCollection();
 
 if(count($AllImages) > 0) {
    //处理
 }
 代码如下 复制代码

 

/*
  * 使用POI读取EXCEL文件
  */
 import java.io.File;
 import java.io.FileInputStream;
 import java.util.ArrayList;
 
 import org.apache.poi.hssf.usermodel.HSSFCell;
 import org.apache.poi.hssf.usermodel.HSSFRow;
 import org.apache.poi.hssf.usermodel.HSSFSheet;
 import org.apache.poi.hssf.usermodel.HSSFWorkbook;
 
 /**
  *
  * @author Hanbin
  */
 public class ReadExcel {
 
     /**
      * @param args the command line arguments
      */
     public static void main(String[] args)throws Exception {
         read("d:\demo.xls");
     }
    
     public static ArrayList read(String fileName){
         ArrayList list = new ArrayList();
         String sql = "";
         try{
             File f = new File(fileName);
             FileInputStream fis = new FileInputStream(f);
             HSSFWorkbook wbs = new HSSFWorkbook(fis);
             HSSFSheet childSheet = wbs.getSheetAt(0);
             System.out.println("行数:" + childSheet.getLastRowNum());
             for(int i = 4;i<childSheet.getLastRowNum();i++){
                 HSSFRow row = childSheet.getRow(i);
                 System.out.println("列数:" + row.getPhysicalNumberOfCells());
                 if(null != row){
                     for(int k=1;k<row.getPhysicalNumberOfCells();k++){
                         HSSFCell cell;
                         cell = row.getCell((short)k);
                        // System.out.print(getStringCellValue(cell) + "t");
                         list.add(getStringCellValue(cell) + "t");
                     }
                 }
             }
         }catch(Exception e){
             e.printStackTrace();
         }
         return list;
     }
     /**
      * 获取单元格数据内容为字符串类型的数据
      *
      * @param cell Excel单元格
      * @return String 单元格数据内容
      */
     private static String getStringCellValue(HSSFCell cell) {
         String strCell = "";
         switch (cell.getCellType()) {
         case HSSFCell.CELL_TYPE_STRING:
             strCell = cell.getStringCellValue();
             break;
         case HSSFCell.CELL_TYPE_NUMERIC:
             strCell = String.valueOf(cell.getNumericCellValue());
             break;
         case HSSFCell.CELL_TYPE_BOOLEAN:
             strCell = String.valueOf(cell.getBooleanCellValue());
             break;
         case HSSFCell.CELL_TYPE_BLANK:
             strCell = "";
             break;
         default:
             strCell = "";
             break;
         }
         if (strCell.equals("") || strCell == null) {
             return "";
         }
         if (cell == null) {
             return "";
         }
         return strCell;
     }
 }

分页是目前在显示大量结果时所采用的最好的方式。有了下面这些代码的帮助,开发人员可以在多个页面中显示大量的数据。在互联网上,分​页是一般用于搜索结果或是浏览全部信息

php基本分页

 代码如下 复制代码

<?php
// database connection info
$conn = mysql_connect('localhost','dbusername','dbpass') or trigger_error("SQL", E_USER_ERROR);
$db = mysql_select_db('dbname',$conn) or trigger_error("SQL", E_USER_ERROR);

// find out how many rows are in the table
$sql = "SELECT COUNT(*) FROM numbers";
$result = mysql_query($sql, $conn) or trigger_error("SQL", E_USER_ERROR);
$r = mysql_fetch_row($result);
$numrows = $r[0];

// number of rows to show per page
$rowsperpage = 10;
// find out total pages
$totalpages = ceil($numrows / $rowsperpage);

// get the current page or set a default
if (isset($_GET['currentpage']) && is_numeric($_GET['currentpage'])) {
// cast var as int
$currentpage = (int) $_GET['currentpage'];
} else {
// default page num
$currentpage = 1;
} // end if

// if current page is greater than total pages...
if ($currentpage > $totalpages) {
// set current page to last page
$currentpage = $totalpages;
} // end if
// if current page is less than first page...
if ($currentpage < 1) {
// set current page to first page
$currentpage = 1;
} // end if

// the offset of the list, based on current page
$offset = ($currentpage - 1) * $rowsperpage;

// get the info from the db
$sql = "SELECT id, number FROM numbers LIMIT $offset, $rowsperpage";
$result = mysql_query($sql, $conn) or trigger_error("SQL", E_USER_ERROR);

// while there are rows to be fetched...
while ($list = mysql_fetch_assoc($result)) {
// echo data
echo $list['id'] . " : " . $list['number'] . "<br />";
} // end while

/****** build the pagination links ******/
// range of num links to show
$range = 3;

// if not on page 1, don't show back links
if ($currentpage > 1) {
// show << link to go back to page 1
echo " <a href='{$_SERVER['PHP_SELF']}?currentpage=1'><<</a> ";
// get previous page num
$prevpage = $currentpage - 1;
// show < link to go back to 1 page
echo " <a href='{$_SERVER['PHP_SELF']}?currentpage=$prevpage'><</a> ";
} // end if

// loop to show links to range of pages around current page
for ($x = ($currentpage - $range); $x < (($currentpage + $range) + 1); $x++) {
// if it's a valid page number...
if (($x > 0) && ($x <= $totalpages)) {
// if we're on current page...
if ($x == $currentpage) {
// 'highlight' it but don't make a link
echo " [<b>$x</b>] ";
// if not current page...
} else {
// make it a link
echo " <a href='{$_SERVER['PHP_SELF']}?currentpage=$x'>$x</a> ";
} // end else
} // end if
} // end for

// if not on last page, show forward and last page links
if ($currentpage != $totalpages) {
// get next page
$nextpage = $currentpage + 1;
// echo forward link for next page
echo " <a href='{$_SERVER['PHP_SELF']}?currentpage=$nextpage'>></a> ";
// echo forward link for lastpage
echo " <a href='{$_SERVER['PHP_SELF']}?currentpage=$totalpages'>>></a> ";
} // end if
/****** end build pagination links ******/
?>

先看一个常用的php分页类

 代码如下 复制代码

<?php
 /*
  Place code to connect to your DB here.
 */
 include('config.php'); // include your code to connect to DB.

 $tbl_name="";  //your table name
 // How many adjacent pages should be shown on each side?
 $adjacents = 3;
 
 /*
    First get total number of rows in data table.
    If you have a WHERE clause in your query, make sure you mirror it here.
 */
 $query = "SELECT COUNT(*) as num FROM $tbl_name";
 $total_pages = mysql_fetch_array(mysql_query($query));
 $total_pages = $total_pages[num];
 
 /* Setup vars for query. */
 $targetpage = "filename.php";  //your file name  (the name of this file)
 $limit = 2;         //how many items to show per page
 $page = $_GET['page'];
 if($page)
  $start = ($page - 1) * $limit;    //first item to display on this page
 else
  $start = 0;        //if no page var is given, set start to 0
 
 /* Get data. */
 $sql = "SELECT column_name FROM $tbl_name LIMIT $start, $limit";
 $result = mysql_query($sql);
 
 /* Setup page vars for display. */
 if ($page == 0) $page = 1;     //if no page var is given, default to 1.
 $prev = $page - 1;       //previous page is page - 1
 $next = $page + 1;       //next page is page + 1
 $lastpage = ceil($total_pages/$limit);  //lastpage is = total pages / items per page, rounded up.
 $lpm1 = $lastpage - 1;      //last page minus 1
 
 /*
  Now we apply our rules and draw the pagination object.
  We're actually saving the code to a variable in case we want to draw it more than once.
 */
 $pagination = "";
 if($lastpage > 1)
 { 
  $pagination .= "<div class="pagination">";
  //previous button
  if ($page > 1)
   $pagination.= "<a href="$targetpage?page=$prev">� previous</a>";
  else
   $pagination.= "<span class="disabled">� previous</span>"; 
  
  //pages 
  if ($lastpage < 7 + ($adjacents * 2)) //not enough pages to bother breaking it up
  { 
   for ($counter = 1; $counter <= $lastpage; $counter++)
   {
    if ($counter == $page)
     $pagination.= "<span class="current">$counter</span>";
    else
     $pagination.= "<a href="$targetpage?page=$counter">$counter</a>";     
   }
  }
  elseif($lastpage > 5 + ($adjacents * 2)) //enough pages to hide some
  {
   //close to beginning; only hide later pages
   if($page < 1 + ($adjacents * 2))  
   {
    for ($counter = 1; $counter < 4 + ($adjacents * 2); $counter++)
    {
     if ($counter == $page)
      $pagination.= "<span class="current">$counter</span>";
     else
      $pagination.= "<a href="$targetpage?page=$counter">$counter</a>";     
    }
    $pagination.= "...";
    $pagination.= "<a href="$targetpage?page=$lpm1">$lpm1</a>";
    $pagination.= "<a href="$targetpage?page=$lastpage">$lastpage</a>";  
   }
   //in middle; hide some front and some back
   elseif($lastpage - ($adjacents * 2) > $page && $page > ($adjacents * 2))
   {
    $pagination.= "<a href="$targetpage?page=1">1</a>";
    $pagination.= "<a href="$targetpage?page=2">2</a>";
    $pagination.= "...";
    for ($counter = $page - $adjacents; $counter <= $page + $adjacents; $counter++)
    {
     if ($counter == $page)
      $pagination.= "<span class="current">$counter</span>";
     else
      $pagination.= "<a href="$targetpage?page=$counter">$counter</a>";     
    }
    $pagination.= "...";
    $pagination.= "<a href="$targetpage?page=$lpm1">$lpm1</a>";
    $pagination.= "<a href="$targetpage?page=$lastpage">$lastpage</a>";  
   }
   //close to end; only hide early pages
   else
   {
    $pagination.= "<a href="$targetpage?page=1">1</a>";
    $pagination.= "<a href="$targetpage?page=2">2</a>";
    $pagination.= "...";
    for ($counter = $lastpage - (2 + ($adjacents * 2)); $counter <= $lastpage; $counter++)
    {
     if ($counter == $page)
      $pagination.= "<span class="current">$counter</span>";
     else
      $pagination.= "<a href="$targetpage?page=$counter">$counter</a>";     
    }
   }
  }
  
  //next button
  if ($page < $counter - 1)
   $pagination.= "<a href="$targetpage?page=$next">next �</a>";
  else
   $pagination.= "<span class="disabled">next �</span>";
  $pagination.= "</div>n";  
 }
?>

 <?php
  while($row = mysql_fetch_array($result))
  {
 
  // Your while loop here
 
  }
 ?>

<?=$pagination?>
 


实例

 代码如下 复制代码

<?php
class PageView{
    /**页码**/
    public $pageNo = 1;
    /**页大小**/
    public $pageSize = 20;
    /**共多少页**/
    public $pageCount = 0;
    /**总记录数**/
    public $totalNum = 0;
    /**偏移量,当前页起始行**/
    public $offSet = 0;
    /**每页数据**/
    public $pageData = array();
   
    /**是否有上一页**/
    public $hasPrePage = true;
    /**是否有下一页**/
    public $hasNextPage = true;
   
    public $pageNoList = array();
   
    public $jsFunction ='jsFunction';
    /**
     *
     * @param unknown_type $count 总行数
     * @param unknown_type $size 分页大小
     * @param unknown_type $string
     */
    public function __construct($count=0, $size=20,$pageNo=1,$pageData =array(),$jsFunction='jsFunction'){

        $this->totalNum = $count;//总记录数
        $this->pageSize = $size;//每页大小
        $this->pageNo = $pageNo;
        //计算总页数
        $this->pageCount = ceil($this->totalNum/$this->pageSize);
        $this->pageCount = ($this->pageCount<=0)?1:$this->pageCount;
        //检查pageNo
        $this->pageNo = $this->pageNo == 0 ? 1 : $this->pageNo;
        $this->pageNo = $this->pageNo > $this->pageCount? $this->pageCount : $this->pageNo;
       
        //计算偏移
        $this->offset = ( $this->pageNo - 1 ) * $this->pageSize;
        //计算是否有上一页下一页
        $this->hasPrePage = $this->pageNo == 1 ?false:true;

        $this->hasNextPage = $this->pageNo >= $this->pageCount ?false:true;
       
        $this->pageData = $pageData;
        $this->jsFunction = $jsFunction;
       
    }
    /**
     * 分页算法
     * @return
     */
    private function generatePageList(){
        $pageList = array();
        if($this->pageCount <= 9){
            for($i=0;$i<$this->pageCount;$i++){
                array_push($pageList,$i+1);
            }
        }else{
            if($this->pageNo <= 4){
                for($i=0;$i<5;$i++){
                    array_push($pageList,$i+1);
                }
                array_push($pageList,-1);
                array_push($pageList,$this->pageCount);

            }else if($this->pageNo > $this->pageCount - 4){
                array_push($pageList,1);
               
                array_push($pageList,-1);
                for($i=5;$i>0;$i--){
                    array_push($pageList,$this->pageCount - $i+1);
                }
            }else if($this->pageNo > 4 && $this->pageNo <= $this->pageCount - 4){
                array_push($pageList,1);
                array_push($pageList,-1);
               
                array_push($pageList,$this->pageNo -2);
                array_push($pageList,$this->pageNo -1);
                array_push($pageList,$this->pageNo);
                array_push($pageList,$this->pageNo + 1);
                array_push($pageList,$this->pageNo + 2);
               
                array_push($pageList,-1);
                array_push($pageList,$this->pageCount);
               
            }
        }
        return $pageList;
    }

    /***
     * 创建分页控件
    * @param
    * @return String
    */
    public function echoPageAsDiv(){
        $pageList = $this->generatePageList();
       
        $pageString ="<div class='pagination'><div class='page-bottom'>";
   
        if(!empty($pageList)){
            if($this->pageCount >1){
                if($this->hasPrePage){
                    $pageString = $pageString ."<a class='page-next' href="javascript:" .$this->jsFunction . "(" . ($this->pageNo-1) . ")">上一页</a>";
                }
                foreach ($pageList as $k=>$p){
                    if($this->pageNo == $p){
                        $pageString = $pageString ."<span class='page-cur'>" . $this->pageNo . "</span>";
                        continue;
                    }
                    if($p == -1){
                        $pageString = $pageString ."<span class='page-break'>...</span>";
                        continue;
                    }
                    $pageString = $pageString ."<a href="javascript:" .$this->jsFunction . "(" . $p . ")">" . $p . "</a>";
                }
               
                if($this->hasNextPage){
                    $pageString = $pageString ."<a class='page-next' href="javascript:" .$this->jsFunction . "(" . ($this->pageNo+1) . ")">下一页</a>";
                }
               
            }
        }
        $pageString = $pageString .("</div></div>");
        return $pageString;
    }
}

?>

css代码

 代码如下 复制代码

<style type="text/css">
<!--
.pagination {font-family: Tahoma;overflow: hidden; padding-top: 12px; text-align: center;}
.pagination-tab { margin-bottom: 20px;}
.pagination a, .pagination .page-cur, .pagination .page-prev_g, .pagination .page-prev, .pagination .page-next, .pagination .page-next_g, .pagination .page-break, .pagination .page-skip {
    display: inline-block;font-family: Tahoma,SimSun,Arial; height: 22px;line-height:22px; margin: 0; min-width: 16px;padding: 0 5px; text-align: center; vertical-align: top; white-space: nowrap;}
.pagination a, .pagination .page-prev_g, .pagination .page-prev, .pagination .page-next, .pagination .page-next_g, .pagination .page-cur, .pagination .page-break {
    border: 1px solid #ed3d83; color:#e9357d; font-weight:bold;}
.pagination a:hover { border: 1px solid #ed3d83;text-decoration: none; background-color:#f95f9d; color:#fff;}
.pagination .page-prev_g, .pagination .page-prev, .pagination .page-next, .pagination .page-next_g { width: 36px; background-image: url(../static/img/page.gif);}
.pagination .page-prev { background-position: -0px -38px; padding-left: 16px;}
.pagination .page-prev_g { background-position:0px -59px; padding-left: 16px; color:#cbcbcb; font-weight:normal;}
.pagination .page-next { background-position: 0px 0px; padding-right: 16px; font-weight:normal;}
.pagination .page-next_g { background-position: -0px -19px; padding-right: 16px; color:#cbcbcb;}
.pagination .page-cur {background-color: #f95f9d; border: 1px solid #ed3d83;color: #fff;font-weight: bold;}
.pagination .page-break {border: medium none; background:none transparent; color:#333;}

-->
</style>

在php页面中的调用方法

 代码如下 复制代码

    $pageNo = $_GET['pageNo'];
        if(empty($pageNo)){
            $pageNo = 1;
        }
        //分页数据
        $pageData = News::getNewsPage($pageNo,$pageSize);
       //取得总行数
        $count = News::getNewsCount();
        //创建分页器
        $p = new PageView($count['0']['TOTAL'],$pageSize,$pageNo,$pageData);
     //生成页码
        $pageViewString = $p->echoPageAsDiv();

在php中缓存分为很多种类型如,内存缓存,文件缓存,页面缓存本文章要来讲述关于php中内存缓存的一些方法,下面我们介绍Memcached缓存和php自带的APC缓存方法。

1.Memcached缓存。
memcached是高性能的分布式内存缓存服务器,通过缓存数据库查询结果,减少数据库访问次数,以提高动态Web应用的速度。memcached 使用了“Key=>Value”方式组织数据。可以允许不同主机上的多个用户同时访问这个缓存系统,一般用于大型网站使用。memcached使用内存缓存数据,所以它是易失的,当服务器重启,或者memcached进程中止,数据便会丢失,所以 memcached不能用来持久保存数据。

过php_memcache的人都会觉得 PHP内存缓存是一个很复杂的东西,其实不然。
memcached 是高效、快速的分布式内存对象缓存系统,主要用于加速 WEB 动态应用程序。
这里介绍memcached在WIN32下的配置及其使用。

一、PHP内存缓存的配置(WIN32环境)

1、下载php_memcache.rar,请从附件下载。

     解压压缩包:php_memcache.rar

     php_memcache.rar压缩包里主包含的文件有:

     /memcached-1.2.1-win32/memcached.exe
     /php_memcache/php_memcache.dll

2、打开命令提示符,指向到memcached.exe所在路径,运行memcached.exe -d start。

3、将php_memcache.dll文件拷贝到PHP的动态文件库的文件夹下。

4、在php.ini文件中加入一行extension=php_memcache.dll。

5、重新启动Apache,然后查看一下phpinfo,如果有memcache,那么就说明安装成功!


例:

 代码如下 复制代码

<?php
//包含 memcached 类文件
require_once('memcached-client.php');
 
//选项设置
$options = array(
 'servers' => array('www.hxsd.com:11211'),//memcached 服务的地址、端口
 'debug' => true,//是否打开debug
 'compress_threshold' => 10240,//超过多少字节的数据时进行压缩
 'persistant' => false//是否使用持久连接
 );
 
//实例化memcached对象
$memcached = new memcached($options);
 
$sql = 'SELECT * FROM table1';
$key = md5($sql);
 
//如果在memcached中没有缓存数据,把缓存数据写入memcached
if(!($datas = $memcached->get($key)))
{
 $conn = mysql_connect('localhost', 'hxsd', '123456');
 mysql_select_db('hxsd');
 $result = mysql_query($sql);
 while($row = mysql_fetch_object($result))
 {
  $datas[] = $row;
 }
 //将数据库中获取到的结果集数据保存到 memcached 中,以供下次访问时使用。
 $memcached->add($key, $datas);
}
else
{
 //直接使用memcached中的缓存数据$datas
}
?>

内存缓存二

APC、EC、Zend加速器的比较

一、APC

APC,全称是Alternative PHP Cache,官方翻译叫”可选PHP缓存”。

主页是 http://pecl.php.net/package/apc

php帮助手册页面: http://cn.php.net/apc


APC是个优化器,自安装之日起,就默默地在后台为您的PHP应用服务了.您的所有PHP代码会被缓存起来. (针对php opcode)

另外,APC可提供一定的内存缓存功能.但是这个功能并不是十分完美,有报告说如果频繁使用APC缓存的写入功能,会导致不可预料的错误.如果想使用这个功能,可以看看apc_fetch,apc_store等几个与apc缓存相关的函数.

安装:

 代码如下 复制代码

# pecl install APC

配置:(/etc/php.inc)

 代码如下 复制代码

extension=apc.so

[apc]

 代码如下 复制代码

apc.enabled = 1

apc.shm_segments = 1

apc.shm_size = 30

apc.optimization = 0

apc.ttl = 7200

apc.user_ttl = 7200

apc.num_files_hint = 1000

apc.mmap_file_mask = /tmp/apc.XXXXXX

文件缓存就是指把缓存生成一个文件,这个文件可以是php,txt等等文件,当我下载访问时就来判断访问上次生成时间,如果超过了我们指定的时间再重新生成一次,否则就直接调用缓存文件,这样就可以减少了对mysql数据库的查询了。

文件缓存原理

1.把需要缓存的数据通过serialize函数序列化后直接保存到文件。在需要使用缓存数据的时候,通过反序列化读入文件内容并复制给需要的变量,然后使用。不经常改动的数据可以写入缓存文件。


文件缓存实例

index.php

 代码如下 复制代码

define('CACHE_ROOT','./');
 include_once('./cache.func.php');
 $file = 'qzp';
 $cacheFile = getCacheFileByID($file,'info/');
 
 print_R(readCache($cacheFile));
 
 $info = array(
      'username'=>'qzp',
      'area_name'=>'admin',
      'mp_name'=>'1234',
      'gh_name'=>'5678');
writeCache($cacheFile,$info);

cache.func.php文件

 function arrayeval($array, $level = 0) {
    $space = '';
    for($i = 0; $i <= $level; $i++) {
        $space .= "t";
    }
    $evaluate = "Arrayn$space(n";
    $comma = $space;
    foreach($array as $key => $val) {
        $key = is_string($key) ? '''.addcslashes($key, ''\').''' : $key;
        $val = !is_array($val) && (!preg_match("/^-?[1-9]d*$/", $val) || strlen($val) > 12) ? '''.addcslashes($val, ''\').''' : $val;
        if(is_array($val)) {
            $evaluate .= "$comma$key => ".arrayeval($val, $level + 1);
        } else {
            $evaluate .= "$comma$key => $val";
        }
        $comma = ",n$space";
    }
    $evaluate .= "n$space)";
    return $evaluate;
}
 
function getCacheFileByID($id,$pre='info/',$md5=true){
 if($md5){
  $md5id = md5($id);
  return CACHE_ROOT.'/'.$pre.substr($md5id,0,2).'/'.substr($md5id,2,2).'/'.$id;
 }else{
  return CACHE_ROOT.'/'.$pre.$id;
 }
}
 
function readCache($filename,$time=0){
 if($datas = @file_get_contents($filename)){
  $datas = unserialize($datas);
  if($time < 1 || (time() - $datas['time'] < $time)){
   return $datas['data'];
  }
 }
 return false;
}
 
function writeCache($filename,$data){
 makeDir(dirname($filename));
 if($handle = fopen($filename,'w+')){
  $datas = array('data'=>$data,'time'=>time());
  flock($handle,LOCK_EX);
  $rs = fputs($handle,serialize($datas));
  flock($handle,LOCK_UN);
  fclose($handle);
  if($rs!==false){
   return true;
  }
 }
 return false;
}
 
function makeDir($path)
{
 if (! file_exists ( $path )) {
  makeDir ( dirname ( $path ) );
  if (! mkdir ( $path, 0777 ))
  die ( '无法创建文件夹' . $path );
 }
}

把要缓存的文件序列化下存放起来,当使用的时候反序列化回来使用。

使用对PHP模板数据进行缓存的工具smarty。smarty将HTML文件缓存成一个静态的HTML页,需要缓存的模板文件可以使用smarty。
例:

 代码如下 复制代码

<?php
//包含Smarty类库
require('libs/Smarty.class.php');
 
//创建Smarty类的对象
$smarty = new Smarty;
 
//启用缓存
$smarty->caching = true;
 
//指定缓存文件保存的目录
$smarty->cache_dir = "./cache/";
 
//也会把输出保存
$smarty->display('index.tpl')
?>

[!--infotagslink--]

相关文章

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

    下面小编来给大家演示几个php操作zip文件的实例,我们可以读取zip包中指定文件与删除zip包中指定文件,下面来给大这介绍一下。 从zip压缩文件中提取文件 代...2016-11-25
  • 使用PHP+JavaScript将HTML页面转换为图片的实例分享

    这篇文章主要介绍了使用PHP+JavaScript将HTML元素转换为图片的实例分享,文后结果的截图只能体现出替换的字体,也不能说将静态页面转为图片可以加快加载,只是这种做法比较interesting XD需要的朋友可以参考下...2016-04-19
  • Jupyter Notebook读取csv文件出现的问题及解决

    这篇文章主要介绍了JupyterNotebook读取csv文件出现的问题及解决,具有很好的参考价值,希望对大家有所帮助。如有错误或未考虑完全的地方,望不吝赐教...2023-01-06
  • C#从数据库读取图片并保存的两种方法

    这篇文章主要介绍了C#从数据库读取图片并保存的方法,帮助大家更好的理解和使用c#,感兴趣的朋友可以了解下...2021-01-16
  • Python 图片转数组,二进制互转操作

    这篇文章主要介绍了Python 图片转数组,二进制互转操作,具有很好的参考价值,希望对大家有所帮助。一起跟随小编过来看看吧...2021-03-09
  • Photoshop古装美女图片转为工笔画效果制作教程

    今天小编在这里就来给各位Photoshop的这一款软件的使用者们来说说把古装美女图片转为细腻的工笔画效果的制作教程,各位想知道方法的使用者们,那么下面就快来跟着小编一...2016-09-14
  • php抓取网站图片并保存的实现方法

    php如何实现抓取网页图片,相较于手动的粘贴复制,使用小程序要方便快捷多了,喜欢编程的人总会喜欢制作一些简单有用的小软件,最近就参考了网上一个php抓取图片代码,封装了一个php远程抓取图片的类,测试了一下,效果还不错分享...2015-10-30
  • Photoshop打开PSD文件空白怎么解决

    有时我们接受或下载到的PSD文件打开是空白的,那么我们要如何来解决这个 问题了,下面一聚教程小伙伴就为各位介绍Photoshop打开PSD文件空白解决办法。 1、如我们打开...2016-09-14
  • 解决python 使用openpyxl读写大文件的坑

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

    这篇文章主要介绍了C#实现HTTP下载文件的方法,包括了HTTP通信的创建、本地文件的写入等,非常具有实用价值,需要的朋友可以参考下...2020-06-25
  • C#操作本地文件及保存文件到数据库的基本方法总结

    C#使用System.IO中的文件操作方法在Windows系统中处理本地文件相当顺手,这里我们还总结了在Oracle中保存文件的方法,嗯,接下来就来看看整理的C#操作本地文件及保存文件到数据库的基本方法总结...2020-06-25
  • jquery左右滚动焦点图banner图片鼠标经过显示上下页按钮

    jquery左右滚动焦点图banner图片鼠标经过显示上下页按钮...2013-10-13
  • SpringBoot实现excel文件生成和下载

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

    利用form表单的target属性和iframe 一、上传文件的一个php教程方法。 该方法接受一个$file参数,该参数为从客户端获取的$_files变量,返回重新命名后的文件名,如果上传失...2016-11-25
  • php批量替换内容或指定目录下所有文件内容

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

    又码了一个周末的代码,这次在做一些关于文件上传的东西。(PHP UPLOAD)小有收获项目是一个BT种子列表,用户有权限上传自己的种子,然后配合BT TRACK服务器把种子的信息写出来...2016-11-25
  • Zend studio文件注释模板设置方法

    步骤:Window -> PHP -> Editor -> Templates,这里可以设置(增、删、改、导入等)管理你的模板。新建文件注释、函数注释、代码块等模板的实例新建模板,分别输入Name、Description、Patterna)文件注释Name: 3cfileDescriptio...2013-10-04
  • AI源文件转photoshop图像变模糊问题解决教程

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

    这篇文章主要介绍了C++万能库头文件在vs中的安装步骤(图文),文中通过示例代码介绍的非常详细,对大家的学习或者工作具有一定的参考学习价值,需要的朋友们下面随着小编来一起学习学习吧...2021-02-23
  • php文件上传你必须知道的几点

    本篇文章主要说明的是与php文件上传的相关配置的知识点。PHP文件上传功能配置主要涉及php.ini配置文件中的upload_tmp_dir、upload_max_filesize、post_max_size等选项,下面一一说明。打开php.ini配置文件找到File Upl...2015-10-21