mirror of
https://github.com/fofolee/uTools-Manuals.git
synced 2025-06-18 13:57:03 +08:00
41 lines
2.2 KiB
HTML
41 lines
2.2 KiB
HTML
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
|
||
<html>
|
||
<head>
|
||
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
|
||
<title>返回当前 PHP 版本所支持的图像类型</title>
|
||
</head>
|
||
<body class="docs"><div id="layout">
|
||
<div id="layout-content"><div id="function.imagetypes" class="refentry">
|
||
<div class="refnamediv">
|
||
<h1 class="refname">imagetypes</h1>
|
||
<p class="verinfo">(PHP 4 >= 4.0.2, PHP 5, PHP 7)</p><p class="refpurpose"><span class="refname">imagetypes</span> — <span class="dc-title">返回当前 PHP 版本所支持的图像类型</span></p>
|
||
|
||
</div>
|
||
<div class="refsect1 unknown-seealsp" id="refsect1-function.imagetypes-unknown-seealsp">
|
||
<h3 class="title">说明</h3>
|
||
<div class="methodsynopsis dc-description">
|
||
<span class="methodname"><strong>imagetypes</strong></span>
|
||
( <span class="methodparam">void</span>
|
||
) : <span class="type">int</span></div>
|
||
|
||
<p class="para rdfs-comment">
|
||
本函数以比特字段方式返回与当前 PHP 版本关联的 GD
|
||
库所支持的图像格式。将返回以下结果,<strong><code>IMG_GIF</code></strong>
|
||
| <strong><code>IMG_JPG</code></strong>
|
||
| <strong><code>IMG_PNG</code></strong>
|
||
| <strong><code>IMG_WBMP</code></strong>| <strong><code>IMG_XPM</code></strong>。
|
||
例如要检查是否支持 PNG,这样做:
|
||
<div class="example" id="example-3744">
|
||
<p><strong>Example #1 <span class="function"><strong>imagetypes()</strong></span> 例子</strong></p>
|
||
<div class="example-contents">
|
||
<div class="phpcode"><pre><span style="color: #000000">
|
||
<span style="color: #0000BB"><?php<br /></span><span style="color: #007700">if (</span><span style="color: #0000BB">imagetypes</span><span style="color: #007700">() & </span><span style="color: #0000BB">IMG_PNG</span><span style="color: #007700">) {<br /> echo </span><span style="color: #DD0000">"PNG Support is enabled"</span><span style="color: #007700">;<br />}<br /></span><span style="color: #0000BB">?></span>
|
||
</span>
|
||
</pre></div>
|
||
</div>
|
||
|
||
</div>
|
||
</p>
|
||
</div>
|
||
|
||
</div></div></div></body></html> |