php生成缩略图经典类
代码如下 | 复制代码 |
<?php /* * File: SimpleImage.php * Author: Simon Jarvis * Copyright: 2006 Simon Jarvis * Date: 08/11/06 * Link: http://www.white-hat-web-design.co.uk/articles/php-image-resizing.php * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details: * http://www.gnu.org/licenses/gpl.html * */ class SimpleImage { var $image; var $image_type; function load($filename) { $image_info = getimagesize($filename); $this->image_type = $image_info[2]; if( $this->image_type == IMAGETYPE_JPEG ) { $this->image = imagecreatefromjpeg($filename); } elseif( $this->image_type == IMAGETYPE_GIF ) { $this->image = imagecreatefromgif($filename); } elseif( $this->image_type == IMAGETYPE_PNG ) { $this->image = imagecreatefrompng($filename); } } function save($filename, $image_type=IMAGETYPE_JPEG, $compression=75, $permissions=null) { if( $image_type == IMAGETYPE_JPEG ) { imagejpeg($this->image,$filename,$compression); } elseif( $image_type == IMAGETYPE_GIF ) { imagegif($this->image,$filename); } elseif( $image_type == IMAGETYPE_PNG ) { imagepng($this->image,$filename); } if( $permissions != null) { chmod($filename,$permissions); } } function output($image_type=IMAGETYPE_JPEG) { if( $image_type == IMAGETYPE_JPEG ) { imagejpeg($this->image); } elseif( $image_type == IMAGETYPE_GIF ) { imagegif($this->image); } elseif( $image_type == IMAGETYPE_PNG ) { imagepng($this->image); } } function getWidth() { return imagesx($this->image); } function getHeight() { return imagesy($this->image); } function resizeToHeight($height) { $ratio = $height / $this->getHeight(); $width = $this->getWidth() * $ratio; $this->resize($width,$height); } function resizeToWidth($width) { $ratio = $width / $this->getWidth(); $height = $this->getheight() * $ratio; $this->resize($width,$height); } function scale($scale) { $width = $this->getWidth() * $scale/100; $height = $this->getheight() * $scale/100; $this->resize($width,$height); } function resize($width,$height) { $new_image = imagecreatetruecolor($width, $height); imagecopyresampled($new_image, $this->image, 0, 0, 0, 0, $width, $height, $this->getWidth(), $this->getHeight()); $this->image = $new_image; } } ?> |
Usage
Save the above file as SimpleImage.php and take a look at the following examples of how to use the script.
The first example below will load a file named picture.jpg resize it to 250 pixels wide and 400 pixels high and resave it as picture2.jpg
代码如下 | 复制代码 |
<?php |
If you want to resize to a specifed width but keep the dimensions ratio the same then the script can work out the required height for you, just use the resizeToWidth function
代码如下 | 复制代码 |
<?php |
要注意的内容:
1. 邮件的字符集设置, $mail->CharSet = "GB2312"; // 这里指定字符集!在这里我只指定为GB2312因为这样Outlook能正常显示邮件主题,我尝试过设为utf-8但在Outlook下显示乱码。
2. 如果是发送html格式的邮件,那么记得也指定<meta ... charset=GB2312">
3. 如果你想用它来群发邮件的话,记得修改包含文件函数,如:
require("phpmailer/class.phpmailer.php");
改为
require_once("phpmailer/class.phpmailer.php");
否则的话会产生类的重定义。
代码如下 | 复制代码 |
<?php $mail->CharSet = "GB2312"; // 这里指定字符集! |
需要下载PHPMailer文件包phpmailer-1.73.tar.gz 来自开源社区: http://phpmailer.sourceforge.net/
一款实现的生成小图功能的实现代码,有需要的朋友可以参考,每个都有详细的说明参数。代码如下 | 复制代码 |
<form action="uploads.php" method="post" enctype="multipart/form-data"> uploads.php文件 <?php }
|
php教程上传图片后,自动裁剪成缩略图,宽不限高
<?php
// $Id: image.php 1937 2009-01-05 19:09:40Z dualface $
/**
* 定义 Helper_Image 类和 Helper_ImageGD 类
*
* @link http://qeephp.com/
* @copyright Copyright (c) 2006-2009 Qeeyuan Inc. {@link http://www.qeeyuan.com}
* @license New BSD License {@link http://qeephp.com/license/}
* @version $Id: image.php 1937 2009-01-05 19:09:40Z dualface $
* @package helper
*/
/**
* Helper_Image 类封装了针对图像的操作
*
* 开发者不能直接构造该类的实例,而是应该用 Helper_Image::createFromFile()
* 静态方法创建一个 Image 类的实例。
*
* 操作大图片时,请确保 php 能够分配足够的内存。
*
* @author YuLei Liao <liaoyulei@qeeyuan.com>
* @version $Id: image.php 1937 2009-01-05 19:09:40Z dualface $
* @package helper
*/
abstract class Helper_Image
{
/**
* 从指定文件创建 Helper_ImageGD 对象
*
* 用法:
* @code php
* $image = Helper_Image::createFromFile('1.jpg');
* $image->resize($width, $height);
* $image->saveAsJpeg('2.jpg');
* @endcode
*
* 对于上传的文件,由于其临时文件名中并没有包含扩展名。
* 因此需要采用下面的方法创建 Image 对象:
*
* @code php
* $ext = pathinfo($_FILES['postfile']['name'], PATHINFO_EXTENSION);
* $image = Image::createFromFile($_FILES['postfile']['tmp_name'], $ext);
* @endcode
*
* @param string $filename 图像文件的完整路径
* @param string $fileext 指定扩展名
*
* @return Helper_ImageGD 从文件创建的 Helper_ImageGD 对象
* @throw Q_NotImplementedException
*/
static function createFromFile($filename, $fileext)
{
$fileext = trim(strtolower($fileext), '.');
$ext2functions = array(
'jpg' => 'imagecreatefromjpeg',
'jpeg' => 'imagecreatefromjpeg',
'png' => 'imagecreatefrompng',
'gif' => 'imagecreatefromgif'
);
if (!isset($ext2functions[$fileext]))
{
throw new Q_NotImplementedException(__('imagecreateform' . $fileext));
}
$handle = call_user_func($ext2functions[$fileext], $filename);
return new Helper_ImageGD($handle);
}
/**
* 将 16 进制颜色值转换为 rgb 值
*
* 用法:
* @code php
* $color = '#369';
* list($r, $g, $b) = Helper_Image::hex2rgb($color);
* echo "red: {$r}, green: {$g}, blue: {$b}";
* @endcode
*
* @param string $color 颜色值
* @param string $default 使用无效颜色值时返回的默认颜色
*
* @return array 由 RGB 三色组成的数组
*/
static function hex2rgb($color, $default = 'ffffff')
{
$hex = trim($color, '#&Hh');
$len = strlen($hex);
if ($len == 3)
{
$hex = "{$hex[0]}{$hex[0]}{$hex[1]}{$hex[1]}{$hex[2]}{$hex[2]}";
}
elseif ($len < 6)
{
$hex = $default;
}
$dec = hexdec($hex);
return array(($dec >> 16) & 0xff, ($dec >> 8) & 0xff, $dec & 0xff);
}
}
/**
* Helper_ImageGD 类封装了一个 gd 句柄,用于对图像进行操作
*
* @author YuLei Liao <liaoyulei@qeeyuan.com>
* @version $Id: image.php 1937 2009-01-05 19:09:40Z dualface $
* @package helper
*/
class Helper_ImageGD
{
/**
* GD 资源句柄
*
* @var resource
*/
protected $_handle = null;
/**
* 构造函数
*
* @param resource $handle GD 资源句柄
*/
function __construct($handle)
{
$this->_handle = $handle;
}
/**
* 析构函数
*/
function __destruct()
{
$this->destroy();
}
/**
* 快速缩放图像到指定大小(质量较差)
*
* @param int $width 新的宽度
* @param int $height 新的高度
*
* @return Helper_ImageGD 返回 Helper_ImageGD 对象本身,实现连贯接口
*/
function resize($width, $height)
{
if (is_null($this->_handle)) return $this;
$dest = imagecreatetruecolor($width, $height);
imagecopyresized($dest, $this->_handle, 0, 0, 0, 0,
$width, $height,
imagesx($this->_handle), imagesy($this->_handle));
imagedestroy($this->_handle);
$this->_handle = $dest;
return $this;
}
/**
* 缩放图像到指定大小(质量较好,速度比 resize() 慢)
*
* @param int $width 新的宽度
* @param int $height 新的高度
*
* @return Helper_ImageGD 返回 Helper_ImageGD 对象本身,实现连贯接口
*/
function resampled($width, $height)
{
if (is_null($this->_handle)) return $this;
$dest = imagecreatetruecolor($width, $height);
imagecopyresampled($dest, $this->_handle, 0, 0, 0, 0,
$width, $height,
imagesx($this->_handle), imagesy($this->_handle));
imagedestroy($this->_handle);
$this->_handle = $dest;
return $this;
}
/**
* 调整图像大小,但不进行缩放操作
*
* 用法:
* @code php
* $image->resizeCanvas($width, $height, 'top-left');
* @endcode
*
* $pos 参数指定了调整图像大小时,图像内容按照什么位置对齐。
* $pos 参数的可用值有:
*
* - left: 左对齐
* - right: 右对齐
* - center: 中心对齐
* - top: 顶部对齐
* - bottom: 底部对齐
* - top-left, left-top: 左上角对齐
* - top-right, right-top: 右上角对齐
* - bottom-left, left-bottom: 左下角对齐
* - bottom-right, right-bottom: 右下角对齐
*
* 如果指定了无效的 $pos 参数,则等同于指定 center。
*
* @param int $width 新的高度
* @param int $height 新的宽度
* @param string $pos 调整时图像位置的变化
* @param string $bgcolor 空白部分的默认颜色
*
* @return Helper_ImageGD 返回 Helper_ImageGD 对象本身,实现连贯接口
*/
function resizeCanvas($width, $height, $pos = 'center', $bgcolor = '0xffffff')
{
if (is_null($this->_handle)) return $this;
$dest = imagecreatetruecolor($width, $height);
$sx = imagesx($this->_handle);
$sy = imagesy($this->_handle);
// 根据 pos 属性来决定如何定位原始图片
switch (strtolower($pos))
{
case 'left':
$ox = 0;
$oy = ($height - $sy) / 2;
break;
case 'right':
$ox = $width - $sx;
$oy = ($height - $sy) / 2;
break;
case 'top':
$ox = ($width - $sx) / 2;
$oy = 0;
break;
case 'bottom':
$ox = ($width - $sx) / 2;
$oy = $height - $sy;
break;
case 'top-left':
case 'left-top':
$ox = $oy = 0;
break;
case 'top-right':
case 'right-top':
$ox = $width - $sx;
$oy = 0;
break;
case 'bottom-left':
case 'left-bottom':
$ox = 0;
$oy = $height - $sy;
break;
case 'bottom-right':
case 'right-bottom':
$ox = $width - $sx;
$oy = $height - $sy;
break;
default:
$ox = ($width - $sx) / 2;
$oy = ($height - $sy) / 2;
}
list ($r, $g, $b) = Helper_Image::hex2rgb($bgcolor, '0xffffff');
$bgcolor = imagecolorallocate($dest, $r, $g, $b);
imagefilledrectangle($dest, 0, 0, $width, $height, $bgcolor);
imagecolordeallocate($dest, $bgcolor);
imagecopy($dest, $this->_handle, $ox, $oy, 0, 0, $sx, $sy);
imagedestroy($this->_handle);
$this->_handle = $dest;
return $this;
}
/**
* 在保持图像长宽比的情况下将图像裁减到指定大小
*
* crop() 在缩放图像时,可以保持图像的长宽比,从而保证图像不会拉高或压扁。
*
* crop() 默认情况下会按照 $width 和 $height 参数计算出最大缩放比例,
* 保持裁减后的图像能够最大程度的充满图片。
*
* 例如源图的大小是 800 x 600,而指定的 $width 和 $height 是 200 和 100。
* 那么源图会被首先缩小为 200 x 150 尺寸,然后裁减掉多余的 50 像素高度。
*
* 用法:
* @code php
* $image->crop($width, $height);
* @endcode
*
* 如果希望最终生成图片始终包含完整图像内容,那么应该指定 $options 参数。
* 该参数可用值有:
*
* - fullimage: 是否保持完整图像
* - pos: 缩放时的对齐方式
* - bgcolor: 缩放时多余部分的背景色
* - enlarge: 是否允许放大
* - reduce: 是否允许缩小
*
* 其中 $options['pos'] 参数的可用值有:
*
* - left: 左对齐
* - right: 右对齐
* - center: 中心对齐
* - top: 顶部对齐
* - bottom: 底部对齐
* - top-left, left-top: 左上角对齐
* - top-right, right-top: 右上角对齐
* - bottom-left, left-bottom: 左下角对齐
* - bottom-right, right-bottom: 右下角对齐
*
* 如果指定了无效的 $pos 参数,则等同于指定 center。
*
* $options 中的每一个选项都可以单独指定,例如在允许裁减的情况下将图像放到新图片的右下角。
*
* @code php
* $image->crop($width, $height, array('pos' => 'right-bottom'));
* @endcode
*
* @param int $width 新的宽度
* @param int $height 新的高度
* @param array $options 裁减选项
*
* @return Helper_ImageGD 返回 Helper_ImageGD 对象本身,实现连贯接口
*/
function crop($width, $height, $options = array())
{
if (is_null($this->_handle)) return $this;
$default_options = array(
'fullimage' => false,
'pos' => 'center',
'bgcolor' => '0xfff',
'enlarge' => false,
'reduce' => true,
);
$options = array_merge($default_options, $options);
// 创建目标图像
$dest = imagecreatetruecolor($width, $height);
// 填充背景色
list ($r, $g, $b) = Helper_Image::hex2rgb($options['bgcolor'], '0xffffff');
$bgcolor = imagecolorallocate($dest, $r, $g, $b);
imagefilledrectangle($dest, 0, 0, $width, $height, $bgcolor);
imagecolordeallocate($dest, $bgcolor);
// 根据源图计算长宽比
$full_w = imagesx($this->_handle);
$full_h = imagesy($this->_handle);
$ratio_w = doubleval($width) / doubleval($full_w);
$ratio_h = doubleval($height) / doubleval($full_h);
if ($options['fullimage'])
{
// 如果要保持完整图像,则选择最小的比率
$ratio = $ratio_w < $ratio_h ? $ratio_w : $ratio_h;
}
else
{
// 否则选择最大的比率
$ratio = $ratio_w > $ratio_h ? $ratio_w : $ratio_h;
}
if (!$options['enlarge'] && $ratio > 1) $ratio = 1;
if (!$options['reduce'] && $ratio < 1) $ratio = 1;
// 计算目标区域的宽高、位置
$dst_w = $full_w * $ratio;
$dst_h = $full_h * $ratio;
// 根据 pos 属性来决定如何定位
switch (strtolower($options['pos']))
{
case 'left':
$dst_x = 0;
$dst_y = ($height - $dst_h) / 2;
break;
case 'right':
$dst_x = $width - $dst_w;
$dst_y = ($height - $dst_h) / 2;
break;
case 'top':
$dst_x = ($width - $dst_w) / 2;
$dst_y = 0;
break;
case 'bottom':
$dst_x = ($width - $dst_w) / 2;
$dst_y = $height - $dst_h;
break;
case 'top-left':
case 'left-top':
$dst_x = $dst_y = 0;
break;
case 'top-right':
case 'right-top':
$dst_x = $width - $dst_w;
$dst_y = 0;
break;
case 'bottom-left':
case 'left-bottom':
$dst_x = 0;
$dst_y = $height - $dst_h;
break;
case 'bottom-right':
case 'right-bottom':
$dst_x = $width - $dst_w;
$dst_y = $height - $dst_h;
break;
case 'center':
default:
$dst_x = ($width - $dst_w) / 2;
$dst_y = ($height - $dst_h) / 2;
}
imagecopyresampled($dest, $this->_handle, $dst_x, $dst_y, 0, 0, $dst_w, $dst_h, $full_w, $full_h);
imagedestroy($this->_handle);
$this->_handle = $dest;
return $this;
}
/**
* 保存为 JPEG 文件
*
* @param string $filename 保存文件名
* @param int $quality 品质参数,默认为 80
*
* @return Helper_ImageGD 返回 Helper_ImageGD 对象本身,实现连贯接口
*/
function saveAsJpeg($filename, $quality = 80)
{
imagejpeg($this->_handle, $filename, $quality);
}
/**
* 保存为 PNG 文件
*
* @param string $filename 保存文件名
*
* @return Helper_ImageGD 返回 Helper_ImageGD 对象本身,实现连贯接口
*/
function saveAsPng($filename)
{
imagepng($this->_handle, $filename);
}
/**
* 保存为 GIF 文件
*
* @param string $filename 保存文件名
*
* @return Helper_ImageGD 返回 Helper_ImageGD 对象本身,实现连贯接口
*/
function saveAsGif($filename)
{
imagegif($this->_handle, $filename);
}
/**
* 销毁内存中的图像
*
* @return Helper_ImageGD 返回 Helper_ImageGD 对象本身,实现连贯接口
*/
function destroy()
{
if (!$this->_handle)
{
@imagedestroy($this->_handle);
}
$this->_handle = null;
return $this;
}
}
调用方法
<?php
$image = Helper_Image::createFromFile('c:a.jpg','jpg');
$image->resampled(100, 100); //缩放到100px * 100PX
$image->saveAsJpeg('c:a_output.jpg', 100);
php教程生成缩略图类,支持自定义高和宽。还支持按高和宽截图
<?php
class resizeimage
{
//图片类型
var $type;
//实际宽度
var $width;
//实际高度
var $height;
//改变后的宽度
var $resize_width;
//改变后的高度
var $resize_height;
//是否裁图
var $cut;
//源图象
var $srcimg;
//目标图象地址
var $dstimg;
//临时创建的图象
var $im;
function resizeimage($img, $wid, $hei,$c,$dstpath)
{
$this->srcimg = $img;
$this->resize_width = $wid;
$this->resize_height = $hei;
$this->cut = $c;
//图片的类型$this->type = strtolower(substr(strrchr($this->srcimg,"."),1));
//初始化图象
$this->initi_img();
//目标图象地址
$this -> dst_img($dstpath);
//--
$this->width = imagesx($this->im);
$this->height = imagesy($this->im);
//生成图象
$this->newimg();
ImageDestroy ($this->im);
}
function newimg()
{
//改变后的图象的比例
$resize_ratio = ($this->resize_width)/($this->resize_height);
//实际图象的比例
$ratio = ($this->width)/($this->height);
if(($this->cut)=="1")
//裁图
{
if($ratio>=$resize_ratio)
//高度优先
{
$newimg = imagecreatetruecolor($this->resize_width,$this->resize_height);
imagecopyresampled($newimg, $this->im, 0, 0, 0, 0, $this->resize_width,$this->resize_height, (($this->height)*$resize_ratio), $this->height);
ImageJpeg ($newimg,$this->dstimg);
}
if($ratio<$resize_ratio)
//宽度优先
{
$newimg = imagecreatetruecolor($this->resize_width,$this->resize_height);
imagecopyresampled($newimg, $this->im, 0, 0, 0, 0, $this->resize_width, $this->resize_height, $this->width, (($this->width)/$resize_ratio));
ImageJpeg ($newimg,$this->dstimg);
}
}
else
//不裁图
{
if($ratio>=$resize_ratio)
{
$newimg = imagecreatetruecolor($this->resize_width,($this->resize_width)/$ratio);
imagecopyresampled($newimg, $this->im, 0, 0, 0, 0, $this->resize_width, ($this->resize_width)/$ratio, $this->width, $this->height);
ImageJpeg ($newimg,$this->dstimg);
}
if($ratio<$resize_ratio)
{
$newimg = imagecreatetruecolor(($this->resize_height)*$ratio,$this->resize_height);
imagecopyresampled($newimg, $this->im, 0, 0, 0, 0, ($this->resize_height)*$ratio, $this->resize_height, $this->width, $this->height);
ImageJpeg ($newimg,$this->dstimg);
}
}
}
//初始化图象
function initi_img()
{
if($this->type=="jpg")
{
$this->im = imagecreatefromjpeg($this->srcimg);
}
if($this->type=="gif")
{
$this->im = imagecreatefromgif($this->srcimg);
}
if($this->type=="png")
{
$this->im = imagecreatefrompng($this->srcimg);
}
}
//图象目标地址
function dst_img($dstpath)
{
$full_length = strlen($this->srcimg);
$type_length = strlen($this->type);
$name_length = $full_length-$type_length;$name = substr($this->srcimg,0,$name_length-1);
$this->dstimg = $dstpath;//echo $this->dstimg;
}
}$resizeimage = new resizeimage("11.jpg", "200", "150", "1","17.jpg");
相关文章
- 本文介绍两种使用 php 生成二维码的方法。 (1)利用google生成二维码的开放接口,代码如下: /** * google api 二维码生成【QRcode可以存储最多4296个字母数字类型的任意文本,具体可以查看二维码数据格式】 * @param strin...2015-10-21
- 这篇文章主要介绍了Java生成随机姓名、性别和年龄的实现示例,文中通过示例代码介绍的非常详细,对大家的学习或者工作具有一定的参考学习价值,需要的朋友们下面随着小编来一起学习学习吧...2020-10-01
- 这篇文章主要介绍了C#生成随机数功能,涉及C#数学运算与字符串操作相关技巧,具有一定参考借鉴价值,需要的朋友可以参考下...2020-06-25
- 关于生成唯一数字ID的问题,是不是需要使用rand生成一个随机数,然后去数据库查询是否有这个数呢?感觉这样的话有点费时间,有没有其他方法呢?当然不是,其实有两种方法可以解决。 1. 如果你只用php而不用数据库的话,那时间戳+随...2015-11-24
- 下面小编就为大家带来一篇jQuery为动态生成的select元素添加事件的方法。小编觉得挺不错的,现在就分享给大家,也给大家做个参考。一起跟随小编过来看看吧...2016-09-01
- 经常制作开发不同的网站的后台,写过很多种不同的后台导航写法。 最终积累了这种最写法,算是最好的吧...2013-09-29
- js生成随机数主要用到了内置的Math对象的random()方法。用法如:Math.random()。它返回的是一个 0 ~ 1 之间的随机数。有了这么一个方法,那生成任意随机数就好理解了。比如实际中我们可能会有如下的需要: (1)生成一个 0 - 1...2015-10-21
- 这篇文章主要介绍了c#生成高清缩略图的二个示例,需要的朋友可以参考下...2020-06-25
- 验证码是一个现在WEB2.0中常见的一个功能了,像注册、登录又或者是留言页面,都需要注册码来验证当前操作者的合法性,我们会看到有些网站没有验证码,但那是更高级的验证了,...2016-11-25
- 复制代码 代码如下:function getTagStyle(){ $minFontSize=8; //最小字体大小,可根据需要自行更改 $maxFontSize=18; //最大字体大小,可根据需要自行更改 return 'font-size:'.($minFontSize+lcg_value()*(abs($maxFo...2013-10-04
- 下面小编就为大家带来一篇JS生成某个范围的随机数【四种情况详解】。小编觉得挺不错的,现在分享给大家,也给大家做个参考,一起跟随小编过来看看吧...2016-04-22
- 解决办法:$str=”QB”.str_pad(($maxid[0]["max(id)"]+1),5,”0″,STR_PAD_LEFT ); 其中$maxid[0]["max(id)"]+1) 是利用max函数从数据库中找也ID最大的一个值, ID为主键,不会重复。 str_pad() 函数把字符串填充为指...2013-10-04
- 这篇文章主要介绍了C#生成Word文档代码示例,本文直接给出代码实例,需要的朋友可以参考下...2020-06-25
- 本文主要介绍了Vue组件文档生成工具库的方法,文中通过示例代码介绍的非常详细,具有一定的参考价值,感兴趣的小伙伴们可以参考一下...2021-08-11
- 这篇文章主要介绍了PHP简单实现生成txt文件到指定目录的方法,简单对比分析了PHP中fwrite及file_put_contents等函数的使用方法,需要的朋友可以参考下...2016-04-28
- 这款批量生成缩略图代码可以生成指定大小的小图哦,并且支持文件批量上传。 这款教程会用到php文件 view.php config.php funs.php index.php 功能: -------...2016-11-25
- 这篇文章主要介绍了C#实现为一张大尺寸图片创建缩略图的方法,涉及C#创建缩略图的相关图片操作技巧,需要的朋友可以参考下...2020-06-25
- 这篇文章主要介绍了史上最简洁C# 生成条形码图片思路及示例分享,需要的朋友可以参考下...2020-06-25
- if( isset($_FILES['upImg']) ) { if( $userGroup[$loginArr['group']]['upload'] == 0 ) { echo '{"error":"您所在的用户组无权上传图片!"}'; } else...2016-11-25
- $doc = new domdocument('1.0'); // we want a nice output $doc->formatoutput = true; 代码如下 复制代码 $root = $doc->createelement('bo...2016-11-25