易截截图软件、单文件、免安装、纯绿色、仅160KB

php图片处理类:缩略,裁剪,圆角,倾斜

<?php
/*
    图片处理类:缩略,裁剪,圆角,倾斜
*/
class resizeimage
{
   //图片类型
   var $type;
   //实际宽度
   var $width;
   //实际高度
   var $height;
   //改变后的宽度
   var $resize_width;
   //改变后的高度
   var $resize_height;
   //是否裁图
   var $cut;
   //源图象
   var $srcimg;
   //目标图象地址
   var $dstimg;
   //圆角源
   var $corner;
   var $im;
function resizeimage($img, $corner, $wid, $hei,$c, $corner_radius, $angle)
   {
       $this->srcimg = $img;
       $this->corner = $corner;
       $this->resize_width = $wid;
       $this->resize_height = $hei;
       $this->cut = $c;
       $this->corner_radius = $corner_radius;
       $this->angle = $angle;
       //图片的类型
       $this->type = substr(strrchr($this->srcimg,"."),1);
       //初始化图象
       $this->initi_img();
       //目标图象地址
       $this -> dst_img();
       //--
       $this->width = imagesx($this->im);
       $this->height = imagesy($this->im);
       //生成图象
       $this->newimg();
       ImageDestroy ($this->im);
   }
   function newimg()
   {
       //


相关文档:

优化PHP代码的40条建议


1.如果一个方法可静态化,就对它做静态声明。速率可提升至4倍。
2.echo 比 print 快。
3.使用echo的多重参数(译注:指用逗号而不是句点)代替字符串连接。
4.在执行for循环之前确定最大循环数,不要每循环一次都计算最大值。
5.注销那些不用的变量尤其是大数组,以便释放内存。
6.尽量避免使用__get,__set,__auto ......

[测试]:仿网易V交友PHP版

测试:http://www.yincode.com
用户:test1 test2 test3
密码:123456
=======================================
2010/01/12/18:54:24
=======================================
谷歌浏览器浏览不正常
main.js
function getData(u,m,callBack){
   var ru=u+"&r="+Math.random();
   $(" ......

PHP函数__autoload()和spl_autoload_register()

__autoload($classname){
}
当PHP找不到类文件会调用这个方法,当注册了自己的函数或方法时,PHP不会调用__autoload()函数,而会调用自定义的函数
spl_autoload_register('func_name');
spl_autoload_register(array('class_name','method_name')); ......

PHP安装问题:编译安装php5.2.0时出错解决方案

编译安装php5.2.0时出错解决方案
1.错误信息...................如下
checking for mcrypt support... no
checking for mhash support... no
checking whether to include mime_magic support... no
checking for MING support... no
checking for mSQL support... no
checking for MSSQL support via FreeTDS ......

php进行soap调用

$client = new SoapClient('http://www.webxml.com.cn/WebServices/ChinaZipSearchWebService.asmx?WSDL');
#$ret = $client->__call('getSupportProvince', array());
 
#$ret = $client->__call('getSupportProvinceCity', array());
 
$ret = $client->__call('getSupportCity', array('callP ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号