<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc';
$TOC = array();
$TOC_DEPRECATED = array();
$PARENTS = array();
include_once dirname(__FILE__) ."/toc/ref.filesystem.inc";
$setup = array (
  'home' => 
  array (
    0 => 'index.php',
    1 => 'PHP Manual',
  ),
  'head' => 
  array (
    0 => 'UTF-8',
    1 => 'it',
  ),
  'this' => 
  array (
    0 => 'function.basename.php',
    1 => 'basename',
    2 => 'Restituisce il nome del file dal percorso indicato',
  ),
  'up' => 
  array (
    0 => 'ref.filesystem.php',
    1 => 'Filesystem Funzioni',
  ),
  'prev' => 
  array (
    0 => 'ref.filesystem.php',
    1 => 'Filesystem Funzioni',
  ),
  'next' => 
  array (
    0 => 'function.chgrp.php',
    1 => 'chgrp',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'it',
    'path' => 'reference/filesystem/functions/basename.xml',
  ),
  'history' => 
  array (
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="function.basename" class="refentry">
   <div class="refnamediv">
    <h1 class="refname">basename</h1>
    <p class="verinfo">(PHP 4, PHP 5, PHP 7, PHP 8)</p><p class="refpurpose"><span class="refname">basename</span> &mdash; <span class="dc-title">Restituisce il nome del file dal percorso indicato</span></p>

   </div>
   <div class="refsect1 unknown-529" id="refsect1-function.basename-unknown-529">
    <h3 class="title">Descrizione</h3>
     <div class="methodsynopsis dc-description">
      <span class="methodname"><strong>basename</strong></span>(<span class="methodparam"><span class="type"><a href="language.types.string.php" class="type string">string</a></span> <code class="parameter">$path</code></span>, <span class="methodparam"><span class="type"><a href="language.types.string.php" class="type string">string</a></span> <code class="parameter">$suffix</code><span class="initializer"> = ?</span></span>): <span class="type"><a href="language.types.string.php" class="type string">string</a></span></div>

    <p class="para rdfs-comment">
     Data una stringa contenente il percorso di un file, questa funzione 
     restituisce il nome del file.
     Se il nome del file finisce in <code class="parameter">suffix</code> 
     quest&#039;ultimo verrà tagliato.
    </p>
    <p class="para">
     Su Windows, sia gli slash (<code class="literal">/</code>) che i backslash
     (<code class="literal">\</code>) vengono utilizzati come carattere di separazione delle directory.
     In altri ambienti, si usa solo lo slash semplice
     (<code class="literal">/</code>).
    </p>
    <p class="para">
     <div class="example" id="example-1">
      <p><strong>Example #1 Esempio di <span class="function"><strong>basename()</strong></span></strong></p>
      <div class="example-contents">
<div class="phpcode"><code><span style="color: #000000"><span style="color: #0000BB">&lt;?php<br />$path </span><span style="color: #007700">= </span><span style="color: #DD0000">"/home/httpd/html/index.php"</span><span style="color: #007700">;<br /></span><span style="color: #0000BB">$file </span><span style="color: #007700">= </span><span style="color: #0000BB">basename</span><span style="color: #007700">(</span><span style="color: #0000BB">$path</span><span style="color: #007700">);        </span><span style="color: #FF8000">// la variabile $file contiene "index.php"<br /></span><span style="color: #0000BB">$file </span><span style="color: #007700">= </span><span style="color: #0000BB">basename</span><span style="color: #007700">(</span><span style="color: #0000BB">$path</span><span style="color: #007700">,</span><span style="color: #DD0000">".php"</span><span style="color: #007700">); </span><span style="color: #FF8000">// la variabile $file contiene "index"<br /></span><span style="color: #0000BB">?&gt;</span></span></code></div>
      </div>

     </div>
    </p>
    <blockquote class="note"><p><strong class="note">Nota</strong>: 
     <p class="para">
      Il parametro <code class="parameter">suffix</code> è stato aggiunto in PHP 4.1.0.
     </p>
    </p></blockquote>
    <p class="para">
     Vedere anche <span class="function"><a href="function.dirname.php" class="function">dirname()</a></span>
    </p>
   </div>

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