欧美日韩精品在线,国内精品久久久久久久久,一级毛片恃级毛片直播,清纯唯美亚洲综合欧美色

php生成圖片縮略圖的方法_PHP教程

編輯Tag賺U幣
教程Tag:暫無Tag,歡迎添加,賺取U幣!

推薦:php獲取網(wǎng)頁里所有圖片并存入數(shù)組的方法
本文實例講述了php獲取網(wǎng)頁里所有圖片并存入數(shù)組的方法。分享給大家供大家參考。具體如下: 希望本文所述對大家的php程序設(shè)計有所幫助。

這篇文章主要介紹了php生成圖片縮略圖的方法,涉及php操作圖片的技巧,非常具有實用價值,需要的朋友可以參考下

本文實例講述了php生成圖片縮略圖的方法。分享給大家供大家參考。具體如下:

這里需要用到GD2 library

  1. function make_thumb($src,$dest,$desired_width
  2.    
  3.   /* read the source image */ 
  4.   $source_image = imagecreatefromjpeg($src); 
  5.   $width = imagesx($source_image); 
  6.   $height = imagesy($source_image); 
  7.   /* find the "desired height" of this thumbnail, relative to the desired width */ 
  8.   $desired_height = floor($height*($desired_width/$width)); 
  9.   /* create a new, "virtual" image */ 
  10.   $virtual_image = imagecreatetruecolor($desired_width,$desired_height); 
  11.   /* copy source image at a resized size */ 
  12.   imagecopyresized($virtual_image,$source_image,0,0,0,0,$desired_width,$desired_height,$width,$height); 
  13.   /* create the physical thumbnail image to its destination */ 
  14.   imagejpeg($virtual_image,$dest, 83); 

分享:經(jīng)典PHP加密解密函數(shù)Authcode()修復(fù)版代碼
Authcode這個函數(shù)很多人都使用,這函數(shù)來自Discuz程序,用于加密解密字符串,可以設(shè)置鑰匙(key)和過期時間,在很多時候都用得著。原版的函數(shù)代碼可能會生成+、/、這樣的字符,導(dǎo)致通過URL傳值取回時被轉(zhuǎn)義,導(dǎo)致無法解密。火端網(wǎng)絡(luò)稍加修改,把這幾個字符替換成其它

來源:模板無憂//所屬分類:PHP教程/更新時間:2015-04-08
相關(guān)PHP教程