<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc';
$TOC = array();
$TOC_DEPRECATED = array();
$PARENTS = array();
include_once dirname(__FILE__) ."/toc/class.splfileinfo.inc";
$setup = array (
  'home' => 
  array (
    0 => 'index.php',
    1 => 'PHP Manual',
  ),
  'head' => 
  array (
    0 => 'UTF-8',
    1 => 'de',
  ),
  'this' => 
  array (
    0 => 'splfileinfo.getextension.php',
    1 => 'SplFileInfo::getExtension',
    2 => 'Gets the file extension',
  ),
  'up' => 
  array (
    0 => 'class.splfileinfo.php',
    1 => 'SplFileInfo',
  ),
  'prev' => 
  array (
    0 => 'splfileinfo.getctime.php',
    1 => 'SplFileInfo::getCTime',
  ),
  'next' => 
  array (
    0 => 'splfileinfo.getfileinfo.php',
    1 => 'SplFileInfo::getFileInfo',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'en',
    'path' => 'reference/spl/splfileinfo/getextension.xml',
  ),
  'history' => 
  array (
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="splfileinfo.getextension" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">SplFileInfo::getExtension</h1>
  <p class="verinfo">(PHP 5 &gt;= 5.3.6, PHP 7, PHP 8)</p><p class="refpurpose"><span class="refname">SplFileInfo::getExtension</span> &mdash; <span class="dc-title">Gets the file extension</span></p>

 </div>

 <div class="refsect1 description" id="refsect1-splfileinfo.getextension-description">
  <h3 class="title">Beschreibung</h3>
  <div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="methodname"><strong>SplFileInfo::getExtension</strong></span>(): <span class="type"><a href="language.types.string.php" class="type string">string</a></span></div>

  <p class="para rdfs-comment">
    Retrieves the file extension.
  </p>

 </div>


 <div class="refsect1 parameters" id="refsect1-splfileinfo.getextension-parameters">
  <h3 class="title">Parameter-Liste</h3>
  <p class="para">Diese Funktion besitzt keine Parameter.</p>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-splfileinfo.getextension-returnvalues">
  <h3 class="title">Rückgabewerte</h3>
  <p class="para">
    Returns a <span class="type"><a href="language.types.string.php" class="type string">string</a></span> containing the file extension, or an
    empty <span class="type"><a href="language.types.string.php" class="type string">string</a></span> if the file has no extension.
  </p>
 </div>


 <div class="refsect1 examples" id="refsect1-splfileinfo.getextension-examples">
  <h3 class="title">Beispiele</h3>
  <div class="example" id="example-1">
   <p><strong>Beispiel #1 <span class="function"><strong>SplFileInfo::getExtension()</strong></span> example</strong></p>
   <div class="example-contents">
<div class="phpcode"><code><span style="color: #000000"><span style="color: #0000BB">&lt;?php<br /><br />$info </span><span style="color: #007700">= new </span><span style="color: #0000BB">SplFileInfo</span><span style="color: #007700">(</span><span style="color: #DD0000">'foo.txt'</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">var_dump</span><span style="color: #007700">(</span><span style="color: #0000BB">$info</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">getExtension</span><span style="color: #007700">());<br /><br /></span><span style="color: #0000BB">$info </span><span style="color: #007700">= new </span><span style="color: #0000BB">SplFileInfo</span><span style="color: #007700">(</span><span style="color: #DD0000">'photo.jpg'</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">var_dump</span><span style="color: #007700">(</span><span style="color: #0000BB">$info</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">getExtension</span><span style="color: #007700">());<br /><br /></span><span style="color: #0000BB">$info </span><span style="color: #007700">= new </span><span style="color: #0000BB">SplFileInfo</span><span style="color: #007700">(</span><span style="color: #DD0000">'something.tar.gz'</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">var_dump</span><span style="color: #007700">(</span><span style="color: #0000BB">$info</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">getExtension</span><span style="color: #007700">());<br /><br /></span><span style="color: #0000BB">?&gt;</span></span></code></div>
   </div>

   <div class="example-contents"><p>Das oben gezeigte Beispiel erzeugt folgende Ausgabe:</p></div>
   <div class="example-contents screen">
<div class="examplescode"><pre class="examplescode">string(3) &quot;txt&quot;
string(3) &quot;jpg&quot;
string(2) &quot;gz&quot;</pre>
</div>
   </div>
  </div>
 </div>


 <div class="refsect1 notes" id="refsect1-splfileinfo.getextension-notes">
  <h3 class="title">Anmerkungen</h3>
  <blockquote class="note"><p><strong class="note">Hinweis</strong>: 
   <p class="para">
    Another way of getting the extension is to use the 
    <span class="function"><a href="function.pathinfo.php" class="function">pathinfo()</a></span> function.
   </p>
   <div class="informalexample">
    <div class="example-contents">
<div class="phpcode"><code><span style="color: #000000"><span style="color: #0000BB">&lt;?php<br />$extension </span><span style="color: #007700">= </span><span style="color: #0000BB">pathinfo</span><span style="color: #007700">(</span><span style="color: #0000BB">$info</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">getFilename</span><span style="color: #007700">(), </span><span style="color: #0000BB">PATHINFO_EXTENSION</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">?&gt;</span></span></code></div>
    </div>

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

 <div class="refsect1 seealso" id="refsect1-splfileinfo.getextension-seealso">
  <h3 class="title">Siehe auch</h3>
  <ul class="simplelist">
   <li><span class="methodname"><a href="splfileinfo.getfilename.php" class="methodname" rel="rdfs-seeAlso">SplFileInfo::getFilename()</a> - Gets the filename</span></li>
   <li><span class="methodname"><a href="splfileinfo.getbasename.php" class="methodname" rel="rdfs-seeAlso">SplFileInfo::getBasename()</a> - Gets the base name of the file</span></li>
   <li><span class="function"><a href="function.pathinfo.php" class="function" rel="rdfs-seeAlso">pathinfo()</a> - Liefert Informationen &uuml;ber einen Dateipfad</span></li>
  </ul>
 </div>


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