uTools-Manuals/docs/php/imagetypes.html
2019-04-08 23:22:26 +08:00

41 lines
2.2 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<!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 &gt;= 4.0.2, PHP 5, PHP 7)</p><p class="refpurpose"><span class="refname">imagetypes</span> &mdash; <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">&lt;?php<br /></span><span style="color: #007700">if&nbsp;(</span><span style="color: #0000BB">imagetypes</span><span style="color: #007700">()&nbsp;&amp;&nbsp;</span><span style="color: #0000BB">IMG_PNG</span><span style="color: #007700">)&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;echo&nbsp;</span><span style="color: #DD0000">"PNG&nbsp;Support&nbsp;is&nbsp;enabled"</span><span style="color: #007700">;<br />}<br /></span><span style="color: #0000BB">?&gt;</span>
</span>
</pre></div>
</div>
</div>
</p>
</div>
</div></div></div></body></html>