- PHP 正则表达式(PCRE)
- PHP 图像处理
- PHP 5 Array 函数
- PHP 5 Calendar 函数
- PHP cURL 函数
- PHP 5 Date/Time 函数
- PHP 5 Directory 函数
- PHP Error 和 Logging 函数
- PHP 5 Filesystem 函数
- PHP Filter 函数
- PHP FTP 函数
- PHP HTTP 函数
- PHP Libxml 函数
- PHP Mail 函数
- PHP 5 Math 函数
- PHP 杂项 函数
- PHP 5 MySQLi 函数
- PHP 5 SimpleXML 函数
- PHP lcfirst() 函数
- PHP 5 String 函数
- PHP XML Parser 函数
- PHP Zip File 函数
- PHP 5 时区
PHP image_type_to_extension - 获取图片后缀
image_type_to_extension — 根据指定的图像类型返回对应的后缀名。
语法
string image_type_to_extension ( int $imagetype [, bool $include_dot = TRUE ] )
根据给定的常量 IMAGETYPE_XXX 返回后缀名。
实例
<?php // 创建图像实例 $im = imagecreatetruecolor(100, 100); // 保存图像 png 格式 imagepng($im, './test' . image_type_to_extension(IMAGETYPE_PNG)); imagedestroy($im); ?>
执行以上文件会在当期目录下生成一个 test.png 的图片。
关注微信小程序
扫描二维码
程序员编程王