array ( 0 => 'index.php', 1 => 'PHP Manual', ), 'head' => array ( 0 => 'UTF-8', 1 => 'zh', ), 'this' => array ( 0 => 'function.imagetypes.php', 1 => 'imagetypes', ), 'up' => array ( 0 => 'ref.image.php', 1 => 'GD 和图像处理 函数', ), 'prev' => array ( 0 => 'function.imagettftext.php', 1 => 'imagettftext', ), 'next' => array ( 0 => 'function.imagewbmp.php', 1 => 'imagewbmp', ), 'alternatives' => array ( ), 'source' => array ( 'lang' => 'zh', 'path' => 'reference/image/functions/imagetypes.xml', ), ); $setup["toc"] = $TOC; $setup["toc_deprecated"] = $TOC_DEPRECATED; $setup["parents"] = $PARENTS; manual_setup($setup); ?>
(PHP 4 >= 4.0.2, PHP 5, PHP 7, PHP 8)
imagetypes — 返回 PHP 内置支持的图像类型
此函数没有参数。
返回链接到 PHP 的 GD 版本支持的图片类型相对应的位字段。返回以下位:IMG_AVIF
| IMG_BMP
|
IMG_GIF
| IMG_JPG
|
IMG_PNG
| IMG_WBMP
|
IMG_XPM
| IMG_WEBP
.
示例 #1 检测 PNG 支持
<?php
if (imagetypes() & IMG_PNG) {
echo "PNG Support is enabled";
}
?>