PHP Common functions

Source: Internet
Author: User

sleep(1)    //延迟执行时间   md5()       //md5加密header(‘Content-Type:text/html; charset=utf-8‘);    //设置页面编码date_default_timezone_set(‘PRC‘);                   //设置时区header("Content-type: text/html; charset=utf-8");   //输出utf-8的头信息strrchr()                                           //查找指定字符在字符串中的最后一次出现@                                                   //错误抑制符   把非致命性的错误 屏蔽掉mt_rand                                             //返回随机整数。 mt_rand(min,max)getimagesize("./images./1.jpg");                    //获取原图的宽度和高度//打开各种类型的图片  (gif jpeg png)  imagecreatefromgif("1.gif");  imagecreatefromjpeg("1.jpeg");  imagecreatefrompng("1.png");//新建图片 width 500px height:300px  imagecreatetruecolor(500,300);                      //3,复制大图粘贴到小图,并且调整图片大小//imagecopyresized//参数1:目标(小图)的资源;//参数2:原图资源 ; //参数3,4:要放到目标图的X,Y;//参数5,6:从原图复制的X,Y;//参数7,8:复制到目标图后的宽度,高度;//参数9,10:要在原图复制的区域的宽,高度imagecopyresized($smail_img,$f_img,0,0,0,0,$smail_w,$smail_h,$img_w,$img_h);//输出图像bool imagegif ( resource $image [, string $filename ] )imagejpeg();imagepng(); //释放资源imagedestroy($old_img); //释放老图片 imagedestroy($new_img); //释放新的图片

PHP Common functions

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.