<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc';
$TOC = array();
$TOC_DEPRECATED = array();
$PARENTS = array();
include_once dirname(__FILE__) ."/toc/ref.image.inc";
$setup = array (
  'home' => 
  array (
    0 => 'index.php',
    1 => 'PHP Manual',
  ),
  'head' => 
  array (
    0 => 'UTF-8',
    1 => 'en',
  ),
  'this' => 
  array (
    0 => 'function.imagetypes.php',
    1 => 'imagetypes',
    2 => 'Return the image types supported by this PHP build',
  ),
  'up' => 
  array (
    0 => 'ref.image.php',
    1 => 'GD and Image Functions',
  ),
  'prev' => 
  array (
    0 => 'function.imagettftext.php',
    1 => 'imagettftext',
  ),
  'next' => 
  array (
    0 => 'function.imagewbmp.php',
    1 => 'imagewbmp',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'en',
    'path' => 'reference/image/functions/imagetypes.xml',
  ),
  'history' => 
  array (
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<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, PHP 8)</p><p class="refpurpose"><span class="refname">imagetypes</span> &mdash; <span class="dc-title">Return the image types supported by this PHP build</span></p>

 </div>
 <div class="refsect1 description" id="refsect1-function.imagetypes-description">
  <h3 class="title">Description</h3>
  <div class="methodsynopsis dc-description">
   <span class="methodname"><strong>imagetypes</strong></span>(): <span class="type"><a href="language.types.integer.php" class="type int">int</a></span></div>

  <p class="para rdfs-comment">
   Returns the image types supported by the current PHP installation.
  </p>
 </div>


 <div class="refsect1 parameters" id="refsect1-function.imagetypes-parameters">
  <h3 class="title">Parameters</h3>
  <p class="para">This function has no parameters.</p>
 </div>

 
 <div class="refsect1 returnvalues" id="refsect1-function.imagetypes-returnvalues">
  <h3 class="title">Return Values</h3>
  <p class="para">
   Returns a bit-field corresponding to the image formats supported by the
   version of GD linked into PHP.  The following bits are returned,
   <strong><code><a href="image.constants.php#constant.img-avif">IMG_AVIF</a></code></strong> | <strong><code><a href="image.constants.php#constant.img-bmp">IMG_BMP</a></code></strong> |
   <strong><code><a href="image.constants.php#constant.img-gif">IMG_GIF</a></code></strong> | <strong><code><a href="image.constants.php#constant.img-jpg">IMG_JPG</a></code></strong> |
   <strong><code><a href="image.constants.php#constant.img-png">IMG_PNG</a></code></strong> | <strong><code><a href="image.constants.php#constant.img-wbmp">IMG_WBMP</a></code></strong> | 
   <strong><code><a href="image.constants.php#constant.img-xpm">IMG_XPM</a></code></strong> | <strong><code><a href="image.constants.php#constant.img-webp">IMG_WEBP</a></code></strong>.
  </p>
 </div>


 <div class="refsect1 changelog" id="refsect1-function.imagetypes-changelog">
  <h3 class="title">Changelog</h3>
  <p class="para">
   <table class="doctable informaltable">
    
     <thead>
      <tr>
       <th>Version</th>
       <th>Description</th>
      </tr>

     </thead>

     <tbody class="tbody">
      <tr>
       <td>8.1.0</td>
       <td>
        <strong><code><a href="image.constants.php#constant.img-avif">IMG_AVIF</a></code></strong> added.
       </td>
      </tr>

      <tr>
       <td>7.2.0</td>
       <td>
        <strong><code><a href="image.constants.php#constant.img-bmp">IMG_BMP</a></code></strong> added.
       </td>
      </tr>

      <tr>
       <td>7.0.10</td>
       <td>
        <strong><code><a href="image.constants.php#constant.img-webp">IMG_WEBP</a></code></strong> added.
       </td>
      </tr>

     </tbody>
    
   </table>

  </p>
 </div>

 
 <div class="refsect1 examples" id="refsect1-function.imagetypes-examples">
  <h3 class="title">Examples</h3>
  <p class="para">
   <div class="example" id="example-1">
    <p><strong>Example #1 Checking for PNG support</strong></p>
    <div class="example-contents">
<div class="phpcode"><code><span style="color: #000000"><span style="color: #0000BB">&lt;?php<br /></span><span style="color: #007700">if (</span><span style="color: #0000BB">imagetypes</span><span style="color: #007700">() &amp; </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">?&gt;</span></span></code></div>
    </div>

   </div>
  </p>
 </div>


 <div class="refsect1 seealso" id="refsect1-function.imagetypes-seealso">
  <h3 class="title">See Also</h3>
  <ul class="simplelist">
   <li><span class="function"><a href="function.gd-info.php" class="function" rel="rdfs-seeAlso">gd_info()</a> - Retrieve information about the currently installed GD library</span></li>
  </ul>
 </div>

</div><?php manual_footer($setup); ?>