<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc';
$TOC = array();
$TOC_DEPRECATED = array();
$PARENTS = array();
include_once dirname(__FILE__) ."/toc/ref.info.inc";
$setup = array (
  'home' => 
  array (
    0 => 'index.php',
    1 => 'PHP Manual',
  ),
  'head' => 
  array (
    0 => 'UTF-8',
    1 => 'it',
  ),
  'this' => 
  array (
    0 => 'function.php-sapi-name.php',
    1 => 'php_sapi_name',
    2 => 'Restituisce il tipo di interfaccia tra il PHP ed il server web',
  ),
  'up' => 
  array (
    0 => 'ref.info.php',
    1 => 'PHP Options/Info Funzioni',
  ),
  'prev' => 
  array (
    0 => 'function.php-ini-scanned-files.php',
    1 => 'php_ini_scanned_files',
  ),
  'next' => 
  array (
    0 => 'function.php-uname.php',
    1 => 'php_uname',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'it',
    'path' => 'reference/info/functions/php-sapi-name.xml',
  ),
  'history' => 
  array (
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="function.php-sapi-name" class="refentry">
   <div class="refnamediv">
    <h1 class="refname">php_sapi_name</h1>
    <p class="verinfo">(PHP 4 &gt;= 4.0.1, PHP 5, PHP 7, PHP 8)</p><p class="refpurpose"><span class="refname">php_sapi_name</span> &mdash; <span class="dc-title">
     Restituisce il tipo di interfaccia tra il PHP ed il server web
    </span></p>

   </div>
   <div class="refsect1 unknown-109" id="refsect1-function.php-sapi-name-unknown-109">
    <h3 class="title">Descrizione</h3>
     <div class="methodsynopsis dc-description">
      <span class="methodname"><strong>php_sapi_name</strong></span>(): <span class="type"><a href="language.types.string.php" class="type string">string</a></span></div>

    <p class="simpara">
     <span class="function"><strong>php_sapi_name()</strong></span> restituisce un testo minuscolo
     che descrive il tipo di interfaccia tra il PHP ed il server web
     (Server API, SAPI). In caso di CGI PHP, la stringa è &quot;cgi&quot;, nel caso si usi mod_php
     per Apache, il testo sarà &quot;apache&quot; e così via.
    </p>
    <p class="para">
     <div class="example" id="example-1">
      <p><strong>Example #1 Esempio di uso di <span class="function"><strong>php_sapi_name()</strong></span></strong></p>
      <div class="example-contents">
<div class="phpcode"><code><span style="color: #000000"><span style="color: #0000BB">&lt;?php<br />$sapi_type </span><span style="color: #007700">= </span><span style="color: #0000BB">php_sapi_name</span><span style="color: #007700">();<br /></span><span style="color: #0000BB">iif </span><span style="color: #007700">(</span><span style="color: #0000BB">substr</span><span style="color: #007700">(</span><span style="color: #0000BB">$sapi_type</span><span style="color: #007700">, </span><span style="color: #0000BB">0</span><span style="color: #007700">, </span><span style="color: #0000BB">3</span><span style="color: #007700">) == </span><span style="color: #DD0000">'cgi'</span><span style="color: #007700">) {<br />    echo </span><span style="color: #DD0000">"Si usa CGI PHP\n"</span><span style="color: #007700">;<br />} else {<br />    echo </span><span style="color: #DD0000">"Non si usa CGI PHP\n"</span><span style="color: #007700">;<br />}<br /></span><span style="color: #0000BB">?&gt;</span></span></code></div>
      </div>

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

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