https://static.06ms.com/static/images/index/3.jpg

PHP缩略图类

<?php
/**
* @author www.iklfy.com
* @copyright 2011
* @filename thumb.class.php
*/
$arrFile = array('p1.jpg', 'p2.gif', 'p4.txt', 'p3.png');
/**
* 得到等比例缩放的长宽
*/
function getNewSize($maxWidth, $maxHeight, $srcWidth, $srcHeight)
{
if ($srcWidth < $srcHeight)
{
$maxWidth = ($maxHeight / $srcHeight) * $srcWidth;
}
else
{
$maxHeight = ($maxWidth / $srcWidth) * $srcHeight;
}
return array('width' => $maxWidth, 'height' => $maxHeight);
}
https://static.06ms.com/static/images/index/14.jpg

PHP下载类代码

<?php
/**
* @author www.iklfy.com
* @copyright 2011
* @filename download.class.php
*/
/*
//文件下载类,以下调用示例代码
$download = new download('php,exe,html', false);
if (!$download->downloadfile($filename))
{
echo $download->geterrormsg();
}
*/
class download
{
var $debug = true;
var $errormsg = '';
var $Filter = array();
var $filename = '';
var $mineType = 'text/plain';
var $xlq_filetype = array();