gd_info()
(PHP 4 >= 4.3.0, PHP 5, PHP 7)
取得当前安装的 GD 库的信息
说明
gd_info(void): array
返回一个关联数组描述了安装的 GD 库的版本和性能。
| 属性 | 含义 |
|---|---|
| GD Version | string值描述了安装的libgd的版本。 |
| Freetype Support | boolean值。如果安装了 Freetype 支持则为TRUE。 |
| Freetype Linkage | string值描述了 Freetype 连接的方法。取值可能为:'with freetype','with TTF library'和'with unknown library'。本单元仅在Freetype Support的值为TRUE时有定义。 |
| T1Lib Support | boolean值。如果包含有T1Lib支持则为TRUE。 |
| GIF Read Support | boolean值。如果包含有读取GIF图像的支持则为TRUE。 |
| GIF Create Support | boolean值。如果包含有创建GIF图像的支持则为TRUE。 |
| JPG Support | boolean值。如果包含有JPG支持则为TRUE。 |
| PNG Support | boolean值。如果包含有PNG支持则为TRUE。 |
| WBMP Support | boolean值。如果包含有WBMP支持则为TRUE。 |
| XBM Support | boolean值。如果包含有XBM支持则为TRUE。 |
使用gd_info()
<?php var_dump(gd_info()); ?>
典型输出为:
array(9) {
["GD Version"]=>
string(24) "bundled (2.0 compatible)"
["FreeType Support"]=>
bool(false)
["T1Lib Support"]=>
bool(false)
["GIF Read Support"]=>
bool(true)
["GIF Create Support"]=>
bool(false)
["JPG Support"]=>
bool(false)
["PNG Support"]=>
bool(true)
["WBMP Support"]=>
bool(true)
["XBM Support"]=>
bool(false)
}
参见imagepng(),imagejpeg(),imagegif(),imagewbmp()和imagetypes()。
