AI编程助手
AI免费问答

一款php批量生成缩略图代码_PHP教程

  2016-07-13 10:45   968浏览 原创

缩放图片的php代码,其中变量classes是一个数组,可以选择任意多个ini文件中指定的设置:

这是一个ini配置文件,上面的代码就要读取这个文件中的图片位置,可以多个。

;translate the image format using the original image size
[translation]
width=0
height=0

;stretch the image to the specified size
[stretch]
width=800
height=600

;zoom the image to the specified width with height auto size
[autoheight]
width=740
height=0

;zoom the image to the specified height with width auto size
[autowidth]
width=0
height=380
*/ ?>

注意:ini文件使用php解释时为注释文件,什么也没有输出,这是为了安全起见而故意为之。而;则是ini文件的注释。

www.bkjia.comtruehttp://www.bkjia.com/PHPjc/632987.htmlTechArticle?php教程 $oimg = test.jpg;//original image name $classes = array('translation','autoheight','autowidth','stretch');//give classes for the new creating images' size which are defi...

php免费学习视频:立即学习
踏上前端学习之旅,开启通往精通之路!从前端基础到项目实战,循序渐进,一步一个脚印,迈向巅峰!

声明:本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn核实处理。